Implement environment record for class constructors (#4207)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -1557,9 +1557,9 @@ opfunc_form_super_reference (ecma_value_t **vm_stack_top_p, /**< current vm stac
|
||||
{
|
||||
if (CBC_FUNCTION_GET_TYPE (frame_ctx_p->shared_p->bytecode_header_p->status_flags) == CBC_FUNCTION_CONSTRUCTOR)
|
||||
{
|
||||
ecma_property_t *prop_p = ecma_op_get_this_property (frame_ctx_p->lex_env_p);
|
||||
ecma_environment_record_t *environment_record_p = ecma_op_get_environment_record (frame_ctx_p->lex_env_p);
|
||||
|
||||
if (!ecma_op_this_binding_is_initialized (prop_p))
|
||||
if (!ecma_op_this_binding_is_initialized (environment_record_p))
|
||||
{
|
||||
return ecma_raise_reference_error (ECMA_ERR_MSG ("Must call super constructor in derived class before "
|
||||
"accessing 'this' or returning from it."));
|
||||
|
||||
Reference in New Issue
Block a user