Remove JERRY_CONTEXT_INVALID_NEW_TARGET (#3643)
Until now JERRY_CONTEXT_INVALID_NEW_TARGET was used to represent whether the eval called from the script directly. This information can be retrieved from the parser, so it simplifies the runtime handling of the new.target. This patch fixes #3630, fixes #3640 and fixes #3641. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -778,7 +778,6 @@ ecma_op_implicit_constructor_handler_cb (const ecma_value_t function_obj, /**< t
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor cannot be invoked without 'new'."));
|
||||
}
|
||||
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target) != JERRY_CONTEXT_INVALID_NEW_TARGET);
|
||||
return ECMA_VALUE_UNDEFINED;
|
||||
} /* ecma_op_implicit_constructor_handler_cb */
|
||||
|
||||
@@ -803,8 +802,6 @@ ecma_op_implicit_constructor_handler_heritage_cb (const ecma_value_t function_ob
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor cannot be invoked without 'new'."));
|
||||
}
|
||||
|
||||
JERRY_ASSERT (JERRY_CONTEXT (current_new_target) != JERRY_CONTEXT_INVALID_NEW_TARGET);
|
||||
|
||||
ecma_object_t *func_obj_p = ecma_get_object_from_value (function_obj);
|
||||
ecma_value_t super_ctor = ecma_op_function_get_super_constructor (func_obj_p);
|
||||
|
||||
|
||||
@@ -1986,7 +1986,6 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT (new_target_object != JERRY_CONTEXT_INVALID_NEW_TARGET);
|
||||
ecma_ref_object (new_target_object);
|
||||
*stack_top_p++ = ecma_make_object_value (new_target_object);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user