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
@@ -55,10 +55,7 @@ ecma_async_generator_enqueue (vm_executable_object_t *async_generator_object_p,
task_p->operation_value = ecma_copy_value_if_not_object (value);
task_p->operation_type = (uint8_t) operation;
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);
ecma_value_t result = ecma_op_create_promise_object (ECMA_VALUE_EMPTY, ECMA_VALUE_UNDEFINED);
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
ecma_value_t result = ecma_op_create_promise_object (ECMA_VALUE_EMPTY, ECMA_VALUE_UNDEFINED, NULL);
task_p->promise = result;
ecma_value_t head = async_generator_object_p->extended_object.u.class_prop.u.head;