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:
@@ -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
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user