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
+5
-5
@@ -240,13 +240,13 @@ vm_run_global (const ecma_compiled_code_t *bytecode_p) /**< pointer to bytecode
|
||||
*/
|
||||
ecma_value_t
|
||||
vm_run_eval (ecma_compiled_code_t *bytecode_data_p, /**< byte-code data */
|
||||
bool is_direct) /**< is eval called in direct mode? */
|
||||
uint32_t parse_opts) /**< ecma_parse_opts_t option bits */
|
||||
{
|
||||
ecma_value_t this_binding;
|
||||
ecma_object_t *lex_env_p;
|
||||
|
||||
/* ECMA-262 v5, 10.4.2 */
|
||||
if (is_direct)
|
||||
if (parse_opts & ECMA_PARSE_DIRECT_EVAL)
|
||||
{
|
||||
this_binding = ecma_copy_value (JERRY_CONTEXT (vm_top_context_p)->this_binding);
|
||||
lex_env_p = JERRY_CONTEXT (vm_top_context_p)->lex_env_p;
|
||||
@@ -270,7 +270,7 @@ vm_run_eval (ecma_compiled_code_t *bytecode_data_p, /**< byte-code data */
|
||||
ecma_value_t completion_value = vm_run (bytecode_data_p,
|
||||
this_binding,
|
||||
lex_env_p,
|
||||
true,
|
||||
parse_opts,
|
||||
NULL,
|
||||
0);
|
||||
|
||||
@@ -3040,7 +3040,7 @@ ecma_value_t
|
||||
vm_run (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data header */
|
||||
ecma_value_t this_binding_value, /**< value of 'ThisBinding' */
|
||||
ecma_object_t *lex_env_p, /**< lexical environment to use */
|
||||
bool is_eval_code, /**< is the code is eval code (ECMA-262 v5, 10.1) */
|
||||
uint32_t parse_opts, /**< ecma_parse_opts_t option bits */
|
||||
const ecma_value_t *arg_list_p, /**< arguments list */
|
||||
ecma_length_t arg_list_len) /**< length of arguments list */
|
||||
{
|
||||
@@ -3080,7 +3080,7 @@ vm_run (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data heade
|
||||
frame_ctx.current_line = 0;
|
||||
#endif /* JERRY_ENABLE_LINE_INFO */
|
||||
frame_ctx.context_depth = 0;
|
||||
frame_ctx.is_eval_code = is_eval_code;
|
||||
frame_ctx.is_eval_code = parse_opts & ECMA_PARSE_DIRECT_EVAL;
|
||||
frame_ctx.call_operation = VM_NO_EXEC_OP;
|
||||
|
||||
/* Use JERRY_MAX() to avoid array declaration with size 0. */
|
||||
|
||||
+2
-2
@@ -282,10 +282,10 @@ typedef enum
|
||||
} vm_call_operation;
|
||||
|
||||
ecma_value_t vm_run_global (const ecma_compiled_code_t *bytecode_p);
|
||||
ecma_value_t vm_run_eval (ecma_compiled_code_t *bytecode_data_p, bool is_direct);
|
||||
ecma_value_t vm_run_eval (ecma_compiled_code_t *bytecode_data_p, uint32_t parse_opts);
|
||||
|
||||
ecma_value_t vm_run (const ecma_compiled_code_t *bytecode_header_p, ecma_value_t this_binding_value,
|
||||
ecma_object_t *lex_env_p, bool is_eval_code, const ecma_value_t *arg_list_p,
|
||||
ecma_object_t *lex_env_p, uint32_t parse_opts, const ecma_value_t *arg_list_p,
|
||||
ecma_length_t arg_list_len);
|
||||
|
||||
bool vm_is_strict_mode (void);
|
||||
|
||||
Reference in New Issue
Block a user