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:
Zoltan Herczeg
2020-02-18 09:49:03 +01:00
committed by GitHub
parent 44e63e038d
commit fda02d4b2a
18 changed files with 366 additions and 288 deletions
+1 -8
View File
@@ -2206,14 +2206,7 @@ lexer_construct_literal_object (parser_context_t *context_p, /**< context */
{
scope_stack_p--;
#if ENABLED (JERRY_ES2015)
bool cond = (scope_stack_p->map_from == literal_index
&& scope_stack_p->map_to != PARSER_SCOPE_STACK_FUNC);
#else /* ENABLED (JERRY_ES2015) */
bool cond = (scope_stack_p->map_from == literal_index);
#endif /* ENABLED (JERRY_ES2015) */
if (cond)
if (scope_stack_p->map_from == literal_index)
{
JERRY_ASSERT (scanner_decode_map_to (scope_stack_p) >= PARSER_REGISTER_START
|| (literal_p->status_flags & LEXER_FLAG_USED));