Adding is_strict flag to interpreter context.

This commit is contained in:
Ruben Ayrapetyan
2014-07-21 20:24:48 +04:00
parent 7e87a1fde0
commit 7a0612d441
3 changed files with 9 additions and 9 deletions
+2
View File
@@ -47,6 +47,8 @@ run_int (void)
int_data.this_binding_p = NULL;
int_data.lex_env_p = ecma_CreateLexicalEnvironment( NULL,
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
FIXME( Strict mode );
int_data.is_strict = false;
ecma_CompletionValue_t completion = run_int_from_pos( &int_data);
+1 -1
View File
@@ -25,7 +25,7 @@ struct __int_data
int pos; /**< current opcode to execute */
ecma_Object_t *this_binding_p; /**< this binding for current context */
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);
+6 -8
View File
@@ -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 T_IDX src_val_descr = opdata.data.assignment.value_right;
// FIXME:
const bool is_strict = false;
int_data->pos++;
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_variable_name.str_p,
is_strict);
int_data->is_strict);
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_variable_name.str_p,
is_strict);
int_data->is_strict);
// FIXME: Move magic strings to header file and make them ecma_Char_t[]
// FIXME: Replace strcmp with ecma_Char_t[] comparator
FIXME( Move magic strings to header file and make them ecma_Char_t[] );
FIXME( Replace strcmp with ecma_Char_t[] comparator );
if ( dst_reference.is_strict
&& ( __strcmp( (char*)dst_reference.referenced_name_p, "eval") == 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,
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,
variable_name.str_p,
false); // FIXME: Pass configurableBindings
false);
/* Skipping SetMutableBinding as we have already checked that there were not
* any binding with specified name in current lexical environment