Introducing Global Environment constructor; using Global Environment as starting lexical environment.
This commit is contained in:
@@ -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);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
Reference in New Issue
Block a user