mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Introducing Global Environment constructor; using Global Environment as starting lexical environment.
This commit is contained in:
parent
bfad8e897d
commit
2c85a55c85
@ -16,6 +16,7 @@
|
||||
#include "deserializer.h"
|
||||
#include "ecma-globals.h"
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-lex-env.h"
|
||||
#include "globals.h"
|
||||
#include "interpreter.h"
|
||||
#include "jerry-libc.h"
|
||||
@ -48,7 +49,7 @@ run_int (void)
|
||||
|
||||
const opcode_counter_t start_pos = 0;
|
||||
ecma_value_t this_binding_value = ecma_make_simple_value( ECMA_SIMPLE_VALUE_UNDEFINED);
|
||||
ecma_object_t *lex_env_p = ecma_create_decl_lex_env (NULL);
|
||||
ecma_object_t *lex_env_p = ecma_op_create_global_environment();
|
||||
FIXME( Strict mode );
|
||||
const bool is_strict = false;
|
||||
|
||||
|
||||
@ -474,6 +474,23 @@ ecma_op_initialize_immutable_binding(ecma_object_t *lex_env_p, /**< lexical envi
|
||||
JERRY_UNREACHABLE();
|
||||
} /* ecma_op_initialize_immutable_binding */
|
||||
|
||||
/**
|
||||
* The Global Environment constructor.
|
||||
*
|
||||
* See also: ECMA-262 v5, 10.2.3
|
||||
*
|
||||
* @return pointer to created lexical environment
|
||||
*/
|
||||
ecma_object_t*
|
||||
ecma_op_create_global_environment( void)
|
||||
{
|
||||
ecma_object_t *glob_obj_p = ecma_op_create_global_object();
|
||||
|
||||
ecma_object_t *glob_env_p = ecma_create_object_lex_env( NULL, glob_obj_p, false);
|
||||
|
||||
return glob_env_p;
|
||||
} /* ecma_op_create_global_environment */
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
@ -40,6 +40,8 @@ extern ecma_completion_value_t ecma_op_implicit_this_value( ecma_object_t *lex_e
|
||||
extern void ecma_op_create_immutable_binding( ecma_object_t *lex_env_p, const ecma_char_t *name_p);
|
||||
extern void ecma_op_initialize_immutable_binding( ecma_object_t *lex_env_p, const ecma_char_t *name_p, ecma_value_t value);
|
||||
|
||||
extern ecma_object_t* ecma_op_create_global_environment( void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user