Fix arrow function this binding resolving if environment record is present (#4878)

This patch fixes #4872 and fixes #4876.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
Robert Fancsik
2021-12-15 11:32:31 +01:00
committed by GitHub
parent 7e0aa086ec
commit 070096f30f
6 changed files with 90 additions and 8 deletions
@@ -1159,6 +1159,13 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
}
this_binding = arrow_func_p->this_binding;
if (JERRY_UNLIKELY (this_binding == ECMA_VALUE_UNINITIALIZED))
{
ecma_environment_record_t *env_record_p = ecma_op_get_environment_record (scope_p);
JERRY_ASSERT (env_record_p);
this_binding = env_record_p->this_binding;
}
break;
}