Adding is_strict flag to interpreter context.
This commit is contained in:
@@ -47,6 +47,8 @@ run_int (void)
|
|||||||
int_data.this_binding_p = NULL;
|
int_data.this_binding_p = NULL;
|
||||||
int_data.lex_env_p = ecma_CreateLexicalEnvironment( NULL,
|
int_data.lex_env_p = ecma_CreateLexicalEnvironment( NULL,
|
||||||
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
|
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
|
||||||
|
FIXME( Strict mode );
|
||||||
|
int_data.is_strict = false;
|
||||||
|
|
||||||
ecma_CompletionValue_t completion = run_int_from_pos( &int_data);
|
ecma_CompletionValue_t completion = run_int_from_pos( &int_data);
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ struct __int_data
|
|||||||
int pos; /**< current opcode to execute */
|
int pos; /**< current opcode to execute */
|
||||||
ecma_Object_t *this_binding_p; /**< this binding for current context */
|
ecma_Object_t *this_binding_p; /**< this binding for current context */
|
||||||
ecma_Object_t *lex_env_p; /**< current lexical environment */
|
ecma_Object_t *lex_env_p; /**< current lexical environment */
|
||||||
int *root_op_addr; /**< pointer to first opcode saved */
|
bool is_strict; /**< is current code execution mode strict? */
|
||||||
};
|
};
|
||||||
|
|
||||||
void init_int (const OPCODE* program_p);
|
void init_int (const OPCODE* program_p);
|
||||||
|
|||||||
@@ -214,9 +214,6 @@ opfunc_assignment (OPCODE opdata, /**< operation data */
|
|||||||
const opcode_arg_type_operand type_value_right = opdata.data.assignment.type_value_right;
|
const opcode_arg_type_operand type_value_right = opdata.data.assignment.type_value_right;
|
||||||
const T_IDX src_val_descr = opdata.data.assignment.value_right;
|
const T_IDX src_val_descr = opdata.data.assignment.value_right;
|
||||||
|
|
||||||
// FIXME:
|
|
||||||
const bool is_strict = false;
|
|
||||||
|
|
||||||
int_data->pos++;
|
int_data->pos++;
|
||||||
|
|
||||||
ecma_Value_t right_value;
|
ecma_Value_t right_value;
|
||||||
@@ -250,7 +247,7 @@ opfunc_assignment (OPCODE opdata, /**< operation data */
|
|||||||
|
|
||||||
src_reference = ecma_OpGetIdentifierReference( int_data->lex_env_p,
|
src_reference = ecma_OpGetIdentifierReference( int_data->lex_env_p,
|
||||||
src_variable_name.str_p,
|
src_variable_name.str_p,
|
||||||
is_strict);
|
int_data->is_strict);
|
||||||
|
|
||||||
ecma_CompletionValue_t get_value_completion = ecma_op_get_value( &src_reference);
|
ecma_CompletionValue_t get_value_completion = ecma_op_get_value( &src_reference);
|
||||||
|
|
||||||
@@ -303,10 +300,10 @@ opfunc_assignment (OPCODE opdata, /**< operation data */
|
|||||||
|
|
||||||
dst_reference = ecma_OpGetIdentifierReference( int_data->lex_env_p,
|
dst_reference = ecma_OpGetIdentifierReference( int_data->lex_env_p,
|
||||||
dst_variable_name.str_p,
|
dst_variable_name.str_p,
|
||||||
is_strict);
|
int_data->is_strict);
|
||||||
|
|
||||||
// FIXME: Move magic strings to header file and make them ecma_Char_t[]
|
FIXME( Move magic strings to header file and make them ecma_Char_t[] );
|
||||||
// FIXME: Replace strcmp with ecma_Char_t[] comparator
|
FIXME( Replace strcmp with ecma_Char_t[] comparator );
|
||||||
if ( dst_reference.is_strict
|
if ( dst_reference.is_strict
|
||||||
&& ( __strcmp( (char*)dst_reference.referenced_name_p, "eval") == 0
|
&& ( __strcmp( (char*)dst_reference.referenced_name_p, "eval") == 0
|
||||||
|| __strcmp( (char*)dst_reference.referenced_name_p, "arguments") == 0 )
|
|| __strcmp( (char*)dst_reference.referenced_name_p, "arguments") == 0 )
|
||||||
@@ -348,9 +345,10 @@ opfunc_var_decl(OPCODE opdata, /**< operation data */
|
|||||||
if ( ecma_IsCompletionValueNormalFalse( ecma_OpHasBinding( int_data->lex_env_p,
|
if ( ecma_IsCompletionValueNormalFalse( ecma_OpHasBinding( int_data->lex_env_p,
|
||||||
variable_name.str_p)) )
|
variable_name.str_p)) )
|
||||||
{
|
{
|
||||||
|
FIXME( Pass configurableBindings that is true if and only if current code is eval code );
|
||||||
ecma_OpCreateMutableBinding( int_data->lex_env_p,
|
ecma_OpCreateMutableBinding( int_data->lex_env_p,
|
||||||
variable_name.str_p,
|
variable_name.str_p,
|
||||||
false); // FIXME: Pass configurableBindings
|
false);
|
||||||
|
|
||||||
/* Skipping SetMutableBinding as we have already checked that there were not
|
/* Skipping SetMutableBinding as we have already checked that there were not
|
||||||
* any binding with specified name in current lexical environment
|
* any binding with specified name in current lexical environment
|
||||||
|
|||||||
Reference in New Issue
Block a user