Fix 'eval' checking in import/export statements. (#2978)

Fixes #2975

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2019-07-17 14:11:13 +02:00
committed by GitHub
parent 329b1fd3f7
commit a44d584842
6 changed files with 34 additions and 3 deletions
+1
View File
@@ -105,6 +105,7 @@ typedef enum
ECMA_PARSE_HAS_SUPER = (1u << 3), /**< the current context has super reference */
ECMA_PARSE_HAS_IMPL_SUPER = (1u << 4), /**< the current context has implicit parent class */
ECMA_PARSE_HAS_STATIC_SUPER = (1u << 5), /**< the current context is a static class method */
ECMA_PARSE_EVAL = (1u << 6), /**< eval is called */
} ecma_parse_opts_t;
/**
+2
View File
@@ -91,6 +91,8 @@ ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, /**< code characters b
parse_opts &= (uint32_t) ~ECMA_PARSE_STRICT_MODE;
}
parse_opts |= ECMA_PARSE_EVAL;
#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES)
JERRY_CONTEXT (resource_name) = ecma_make_magic_string_value (LIT_MAGIC_STRING_RESOURCE_EVAL);
#endif /* ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) */