Fix lexical scoping between scripts (#3558)
This change fixes the handling of lexical blocks when executing multiple scripts, and also fixes a few issues with module environments. After this change, all script files will run in the same context and will have access to lexically scoped global variables of previous scripts, and module environments will no longer have a bound global 'this' value. The REPL implementation in main-unix is also fixed to correctly handle lexically scoped variables. Fixes #3561. JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
@@ -30,9 +30,13 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
void ecma_init_global_lex_env (void);
|
||||
void ecma_finalize_global_lex_env (void);
|
||||
void ecma_init_global_environment (void);
|
||||
void ecma_finalize_global_environment (void);
|
||||
ecma_object_t *ecma_get_global_environment (void);
|
||||
ecma_object_t *ecma_get_global_scope (void);
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
void ecma_create_global_lexical_block (void);
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
void ecma_module_add_lex_env (ecma_object_t *lex_env_p);
|
||||
|
||||
Reference in New Issue
Block a user