Simplify source evaluation options. (#2431)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
committed by
László Langó
parent
76ff084dc7
commit
77d9314b1d
@@ -169,7 +169,7 @@ ecma_builtin_function_dispatch_construct (const ecma_value_t *arguments_list_p,
|
||||
arguments_buffer_size,
|
||||
function_body_buffer_p,
|
||||
function_body_buffer_size,
|
||||
false,
|
||||
ECMA_PARSE_NO_OPTS,
|
||||
&bytecode_data_p);
|
||||
|
||||
if (!ECMA_IS_VALUE_ERROR (ret_value))
|
||||
|
||||
@@ -63,17 +63,13 @@ ecma_builtin_global_object_eval (ecma_value_t this_arg, /**< this argument */
|
||||
JERRY_UNUSED (this_arg);
|
||||
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
|
||||
|
||||
bool is_direct_eval = vm_is_direct_eval_form_call ();
|
||||
uint32_t parse_opts = vm_is_direct_eval_form_call () ? ECMA_PARSE_DIRECT_EVAL : ECMA_PARSE_NO_OPTS;
|
||||
|
||||
/* See also: ECMA-262 v5, 10.1.1 */
|
||||
bool is_called_from_strict_mode_code;
|
||||
if (is_direct_eval)
|
||||
if (parse_opts && vm_is_strict_mode ())
|
||||
{
|
||||
is_called_from_strict_mode_code = vm_is_strict_mode ();
|
||||
}
|
||||
else
|
||||
{
|
||||
is_called_from_strict_mode_code = false;
|
||||
JERRY_ASSERT (parse_opts & ECMA_PARSE_DIRECT_EVAL);
|
||||
parse_opts |= ECMA_PARSE_STRICT_MODE;
|
||||
}
|
||||
|
||||
if (!ecma_is_value_string (x))
|
||||
@@ -85,8 +81,7 @@ ecma_builtin_global_object_eval (ecma_value_t this_arg, /**< this argument */
|
||||
{
|
||||
/* steps 2 to 8 */
|
||||
ret_value = ecma_op_eval (ecma_get_string_from_value (x),
|
||||
is_direct_eval,
|
||||
is_called_from_strict_mode_code);
|
||||
parse_opts);
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
|
||||
Reference in New Issue
Block a user