Adding configuration flag indicating whether Global Environment is bound to Global Object or it is simple declarative lexical environment.
This commit is contained in:
@@ -104,4 +104,10 @@
|
|||||||
*/
|
*/
|
||||||
#define CONFIG_ECMA_EXCEPTION_SUPPORT
|
#define CONFIG_ECMA_EXCEPTION_SUPPORT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Link Global Environment to an empty declarative lexical environment
|
||||||
|
* instead of lexical environment bound to Global Object.
|
||||||
|
*/
|
||||||
|
// #define CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE
|
||||||
|
|
||||||
#endif /* !CONFIG_H */
|
#endif /* !CONFIG_H */
|
||||||
|
|||||||
@@ -498,7 +498,12 @@ ecma_op_initialize_immutable_binding (ecma_object_t *lex_env_p, /**< lexical env
|
|||||||
ecma_object_t*
|
ecma_object_t*
|
||||||
ecma_op_create_global_environment (ecma_object_t *glob_obj_p) /**< the Global object */
|
ecma_op_create_global_environment (ecma_object_t *glob_obj_p) /**< the Global object */
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE
|
||||||
|
(void) glob_obj_p;
|
||||||
|
ecma_object_t *glob_env_p = ecma_create_decl_lex_env (NULL);
|
||||||
|
#else /* !CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */
|
||||||
ecma_object_t *glob_env_p = ecma_create_object_lex_env (NULL, glob_obj_p, false);
|
ecma_object_t *glob_env_p = ecma_create_object_lex_env (NULL, glob_obj_p, false);
|
||||||
|
#endif /* !CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */
|
||||||
|
|
||||||
return glob_env_p;
|
return glob_env_p;
|
||||||
} /* ecma_op_create_global_environment */
|
} /* ecma_op_create_global_environment */
|
||||||
|
|||||||
Reference in New Issue
Block a user