Fix continue label lookup in for statements that have a private scope (#4224)

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
This commit is contained in:
Dániel Bátyai
2020-09-25 10:06:19 +02:00
committed by GitHub
parent 3b7409f3a7
commit 43e03a1ac6
3 changed files with 8 additions and 7 deletions
+8 -1
View File
@@ -2336,11 +2336,18 @@ parser_parse_continue_statement (parser_context_t *context_p) /**< context */
opcode = CBC_JUMP_FORWARD_EXIT_CONTEXT;
}
#if ENABLED (JERRY_ESNEXT)
const bool is_private_scope = (type == PARSER_STATEMENT_PRIVATE_SCOPE
|| type == PARSER_STATEMENT_PRIVATE_CONTEXT);
#else /* !ENABLED (JERRY_ESNEXT) */
const bool is_private_scope = false;
#endif /* !ENABLED (JERRY_ESNEXT) */
if (parser_statement_flags[type] & PARSER_STATM_CONTINUE_TARGET)
{
loop_iterator = iterator;
}
else
else if (!is_private_scope)
{
loop_iterator.current_p = NULL;
}