Allow changing the 'this' binding of a realm (#4357)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-12-14 10:05:30 +01:00
committed by GitHub
parent 7e135b04ed
commit fe29bf7390
15 changed files with 198 additions and 45 deletions
@@ -614,6 +614,7 @@ ecma_builtin_create_global_object (void)
#if ENABLED (JERRY_BUILTIN_REALMS)
ECMA_SET_INTERNAL_VALUE_POINTER (global_object_p->extended_object.u.built_in.realm_value, global_object_p);
global_object_p->extra_realms_bitset = 0;
global_object_p->this_binding = ecma_make_object_value (object_p);
#else /* !ENABLED (JERRY_BUILTIN_REALMS) */
global_object_p->extended_object.u.built_in.continue_instantiated_bitset[0] = 0;
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
@@ -108,6 +108,7 @@ typedef struct
uint32_t extra_instantiated_bitset[1]; /**< extra bit set for instantiated properties */
#if ENABLED (JERRY_BUILTIN_REALMS)
uint32_t extra_realms_bitset; /**< extra bit set for instantiated properties when realms is enabled */
ecma_value_t this_binding; /**< 'this' binding of this global object */
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
jmem_cpointer_t global_env_cp; /**< global lexical environment */
#if ENABLED (JERRY_ESNEXT)