current_new_target -> current_new_target_p (#4478)
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
This commit is contained in:
@@ -143,7 +143,7 @@ ecma_op_create_arraybuffer_object (const ecma_value_t *arguments_list_p, /**< li
|
||||
|
||||
uint32_t length_uint32 = ecma_number_to_uint32 (length_num);
|
||||
|
||||
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target),
|
||||
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p),
|
||||
ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE);
|
||||
|
||||
if (proto_p == NULL)
|
||||
|
||||
@@ -55,10 +55,10 @@ 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);
|
||||
JERRY_CONTEXT (current_new_target) = ecma_builtin_get (ECMA_BUILTIN_ID_PROMISE);
|
||||
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_PROMISE_EXECUTOR_EMPTY);
|
||||
JERRY_CONTEXT (current_new_target) = old_new_target_p;
|
||||
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
|
||||
task_p->promise = result;
|
||||
|
||||
ecma_value_t head = async_generator_object_p->extended_object.u.class_prop.u.head;
|
||||
|
||||
@@ -55,7 +55,7 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target);
|
||||
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p);
|
||||
if (new_target)
|
||||
{
|
||||
prototype_obj_p = ecma_op_get_prototype_from_constructor (new_target, proto_id);
|
||||
|
||||
@@ -373,9 +373,9 @@ ecma_op_container_create (const ecma_value_t *arguments_list_p, /**< arguments l
|
||||
|| lit_id == LIT_MAGIC_STRING_SET_UL
|
||||
|| lit_id == LIT_MAGIC_STRING_WEAKMAP_UL
|
||||
|| lit_id == LIT_MAGIC_STRING_WEAKSET_UL);
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target) != NULL);
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target_p) != NULL);
|
||||
|
||||
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target), proto_id);
|
||||
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p), proto_id);
|
||||
|
||||
if (JERRY_UNLIKELY (proto_p == NULL))
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
|
||||
uint32_t arguments_list_len) /**< number of arguments */
|
||||
{
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target));
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target_p));
|
||||
|
||||
ecma_value_t buffer = arguments_list_len > 0 ? arguments_list_p[0] : ECMA_VALUE_UNDEFINED;
|
||||
|
||||
@@ -121,7 +121,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
|
||||
}
|
||||
|
||||
/* 9. */
|
||||
ecma_object_t *prototype_obj_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target),
|
||||
ecma_object_t *prototype_obj_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p),
|
||||
ECMA_BUILTIN_ID_DATAVIEW_PROTOTYPE);
|
||||
if (JERRY_UNLIKELY (prototype_obj_p == NULL))
|
||||
{
|
||||
|
||||
@@ -491,7 +491,7 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu
|
||||
ecma_builtin_id_t fallback_proto = ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE;
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target);
|
||||
ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target_p);
|
||||
|
||||
if (JERRY_UNLIKELY (parse_opts & (ECMA_PARSE_GENERATOR_FUNCTION | ECMA_PARSE_ASYNC_FUNCTION)))
|
||||
{
|
||||
@@ -649,9 +649,9 @@ ecma_op_create_arrow_function_object (ecma_object_t *scope_p, /**< function's sc
|
||||
arrow_func_p->this_binding = ecma_copy_value_if_not_object (this_binding);
|
||||
arrow_func_p->new_target = ECMA_VALUE_UNDEFINED;
|
||||
|
||||
if (JERRY_CONTEXT (current_new_target) != NULL)
|
||||
if (JERRY_CONTEXT (current_new_target_p) != NULL)
|
||||
{
|
||||
arrow_func_p->new_target = ecma_make_object_value (JERRY_CONTEXT (current_new_target));
|
||||
arrow_func_p->new_target = ecma_make_object_value (JERRY_CONTEXT (current_new_target_p));
|
||||
}
|
||||
return func_p;
|
||||
} /* ecma_op_create_arrow_function_object */
|
||||
@@ -1071,11 +1071,11 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
|
||||
|
||||
if (ecma_is_value_undefined (arrow_func_p->new_target))
|
||||
{
|
||||
JERRY_CONTEXT (current_new_target) = NULL;
|
||||
JERRY_CONTEXT (current_new_target_p) = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_CONTEXT (current_new_target) = ecma_get_object_from_value (arrow_func_p->new_target);
|
||||
JERRY_CONTEXT (current_new_target_p) = ecma_get_object_from_value (arrow_func_p->new_target);
|
||||
}
|
||||
this_binding = arrow_func_p->this_binding;
|
||||
}
|
||||
@@ -1121,7 +1121,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_UNLIKELY (CBC_FUNCTION_GET_TYPE (status_flags) == CBC_FUNCTION_CONSTRUCTOR))
|
||||
{
|
||||
if (JERRY_CONTEXT (current_new_target) == NULL)
|
||||
if (JERRY_CONTEXT (current_new_target_p) == NULL)
|
||||
{
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor cannot be invoked without 'new'."));
|
||||
goto exit;
|
||||
@@ -1363,10 +1363,10 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target);
|
||||
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p);
|
||||
if (JERRY_UNLIKELY (!(JERRY_CONTEXT (status_flags) & ECMA_STATUS_DIRECT_EVAL)))
|
||||
{
|
||||
JERRY_CONTEXT (current_new_target) = NULL;
|
||||
JERRY_CONTEXT (current_new_target_p) = NULL;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -1386,7 +1386,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
JERRY_CONTEXT (current_new_target) = old_new_target_p;
|
||||
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
return result;
|
||||
@@ -1454,14 +1454,14 @@ ecma_op_function_construct_native (ecma_object_t *func_obj_p, /**< Function obje
|
||||
ecma_deref_object (proto_p);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target);
|
||||
JERRY_CONTEXT (current_new_target) = new_target_p;
|
||||
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p);
|
||||
JERRY_CONTEXT (current_new_target_p) = new_target_p;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_value_t ret_value = ecma_op_function_call_native (func_obj_p, this_arg, arguments_list_p, arguments_list_len);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
JERRY_CONTEXT (current_new_target) = old_new_target_p;
|
||||
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (ret_value) || ecma_is_value_object (ret_value))
|
||||
@@ -1520,14 +1520,14 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_object_t *old_new_target = JERRY_CONTEXT (current_new_target);
|
||||
JERRY_CONTEXT (current_new_target) = new_target_p;
|
||||
ecma_object_t *old_new_target = JERRY_CONTEXT (current_new_target_p);
|
||||
JERRY_CONTEXT (current_new_target_p) = new_target_p;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_value_t ret_value = ecma_builtin_dispatch_construct (func_obj_p, arguments_list_p, arguments_list_len);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
JERRY_CONTEXT (current_new_target) = old_new_target;
|
||||
JERRY_CONTEXT (current_new_target_p) = old_new_target;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REALMS)
|
||||
@@ -1572,14 +1572,14 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
}
|
||||
|
||||
/* 6. */
|
||||
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target);
|
||||
JERRY_CONTEXT (current_new_target) = new_target_p;
|
||||
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target_p);
|
||||
JERRY_CONTEXT (current_new_target_p) = new_target_p;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
ecma_value_t ret_value = ecma_op_function_call_simple (func_obj_p, this_arg, arguments_list_p, arguments_list_len);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
JERRY_CONTEXT (current_new_target) = old_new_target_p;
|
||||
JERRY_CONTEXT (current_new_target_p) = old_new_target_p;
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* 13.a */
|
||||
|
||||
@@ -60,7 +60,7 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
|
||||
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id);
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target);
|
||||
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p);
|
||||
if (new_target)
|
||||
{
|
||||
prototype_obj_p = ecma_op_get_prototype_from_constructor (new_target, proto_id);
|
||||
|
||||
@@ -390,9 +390,9 @@ ecma_value_t
|
||||
ecma_op_create_promise_object (ecma_value_t executor, /**< the executor function or object */
|
||||
ecma_promise_executor_type_t type) /**< indicates the type of executor */
|
||||
{
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target) != NULL);
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target_p) != NULL);
|
||||
/* 3. */
|
||||
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target),
|
||||
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (JERRY_CONTEXT (current_new_target_p),
|
||||
ECMA_BUILTIN_ID_PROMISE_PROTOTYPE);
|
||||
|
||||
if (JERRY_UNLIKELY (proto_p == NULL))
|
||||
|
||||
@@ -70,7 +70,7 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
|
||||
#endif /* ENABLED (JERRY_BUILTIN_STRING) */
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (proto_id);
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target);
|
||||
ecma_object_t *new_target = JERRY_CONTEXT (current_new_target_p);
|
||||
if (new_target)
|
||||
{
|
||||
prototype_obj_p = ecma_op_get_prototype_from_constructor (new_target, proto_id);
|
||||
|
||||
Reference in New Issue
Block a user