There is no need to update the scanner info chain after a for/while statement. (#3138)

Fixes #3131.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2019-09-20 11:27:05 +02:00
committed by Robert Fancsik
parent 1acbf83d1a
commit a7c654617d
3 changed files with 22 additions and 2 deletions
+4 -2
View File
@@ -842,8 +842,9 @@ parser_parse_while_statement_end (parser_context_t *context_p) /**< context */
parser_emit_cbc_backward_branch (context_p, (uint16_t) opcode, while_statement.start_offset);
parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
/* Calling scanner_seek is unnecessary because all
* info blocks inside the while statement should be processed. */
scanner_set_location (context_p, &location);
scanner_seek (context_p);
context_p->token = current_token;
} /* parser_parse_while_statement_end */
@@ -1186,8 +1187,9 @@ parser_parse_for_statement_end (parser_context_t *context_p) /**< context */
parser_emit_cbc_backward_branch (context_p, (uint16_t) opcode, for_statement.start_offset);
parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
/* Calling scanner_seek is unnecessary because all
* info blocks inside the for statement should be processed. */
scanner_set_location (context_p, &location);
scanner_seek (context_p);
context_p->token = current_token;
} /* parser_parse_for_statement_end */