Add new.target argument to Promise create (#4606)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-02-24 08:50:05 +01:00
committed by GitHub
parent 5c35370327
commit 1cf2989a64
7 changed files with 18 additions and 35 deletions
+1 -5
View File
@@ -898,15 +898,11 @@ opfunc_async_create_and_await (vm_frame_ctx_t *frame_ctx_p, /**< frame context *
ecma_deref_object ((ecma_object_t *) executable_object_p);
ecma_free_value (result);
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p);
JERRY_CONTEXT (current_new_target_p) = promise_p;
result = ecma_op_create_promise_object (ECMA_VALUE_EMPTY, ECMA_VALUE_UNDEFINED);
result = ecma_op_create_promise_object (ECMA_VALUE_EMPTY, ECMA_VALUE_UNDEFINED, promise_p);
JERRY_ASSERT (ecma_is_value_object (result));
executable_object_p->frame_ctx.block_result = result;
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
return result;
} /* opfunc_async_create_and_await */
+1 -6
View File
@@ -2716,12 +2716,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
if (result == ECMA_VALUE_UNDEFINED)
{
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p);
JERRY_CONTEXT (current_new_target_p) = ecma_builtin_get (ECMA_BUILTIN_ID_PROMISE);
result = ecma_op_create_promise_object (ECMA_VALUE_EMPTY, ECMA_VALUE_UNDEFINED);
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
result = ecma_op_create_promise_object (ECMA_VALUE_EMPTY, ECMA_VALUE_UNDEFINED, NULL);
}
vm_stack_context_type_t context_type = VM_GET_CONTEXT_TYPE (stack_top_p[-1]);