Fix local scoping for functions. (#3559)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -1991,10 +1991,14 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
|
||||
#endif /* ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
if (parse_opts & ECMA_PARSE_DIRECT_EVAL)
|
||||
if (parse_opts & ECMA_PARSE_EVAL)
|
||||
{
|
||||
context.status_flags |= PARSER_IS_EVAL;
|
||||
}
|
||||
if (parse_opts & ECMA_PARSE_DIRECT_EVAL)
|
||||
{
|
||||
context.status_flags |= PARSER_IS_DIRECT_EVAL;
|
||||
}
|
||||
if (parse_opts & ECMA_PARSE_FUNCTION)
|
||||
{
|
||||
context.status_flags |= PARSER_IS_FUNCTION;
|
||||
@@ -2048,12 +2052,6 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
|
||||
context.status_flags |= PARSER_IS_STRICT;
|
||||
}
|
||||
|
||||
if (parse_opts & ECMA_PARSE_EVAL)
|
||||
{
|
||||
/* After this point this flag is set for non-direct evals as well. */
|
||||
context.status_flags |= PARSER_IS_EVAL;
|
||||
}
|
||||
|
||||
context.module_current_node_p = NULL;
|
||||
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
|
||||
@@ -2110,7 +2108,7 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
|
||||
scanner_create_variables (&context, SCANNER_CREATE_VARS_IS_EVAL);
|
||||
scanner_create_variables (&context, SCANNER_CREATE_VARS_IS_SCRIPT);
|
||||
}
|
||||
|
||||
parser_parse_statements (&context);
|
||||
|
||||
Reference in New Issue
Block a user