mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Adding configuration flag indicating whether Global Environment is bound to Global Object or it is simple declarative lexical environment.
This commit is contained in:
parent
dafbaa742e
commit
fbcd393962
@ -104,4 +104,10 @@
|
||||
*/
|
||||
#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 */
|
||||
|
||||
@ -498,7 +498,12 @@ ecma_op_initialize_immutable_binding (ecma_object_t *lex_env_p, /**< lexical env
|
||||
ecma_object_t*
|
||||
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);
|
||||
#endif /* !CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */
|
||||
|
||||
return glob_env_p;
|
||||
} /* ecma_op_create_global_environment */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user