Fix undefined behaviour of global object freezing
Freezing the global object and later trying to add properties to it caused an assertion error (issue #2105). This patch fixes the issue. JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
@@ -146,6 +146,11 @@ ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environme
|
||||
ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
|
||||
|
||||
ecma_value_t completion;
|
||||
if (!ecma_get_object_extensible (binding_obj_p))
|
||||
{
|
||||
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
|
||||
}
|
||||
|
||||
completion = ecma_builtin_helper_def_prop (binding_obj_p,
|
||||
name_p,
|
||||
ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
|
||||
|
||||
Reference in New Issue
Block a user