Bound names of for-in/of statements cannot contain let (#4225)

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 16:33:11 +02:00
committed by GitHub
parent de38764e88
commit f58f15077f
3 changed files with 9 additions and 6 deletions
+9
View File
@@ -1374,6 +1374,15 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
#endif /* ENABLED (JERRY_ESNEXT) */
lexer_expect_identifier (context_p, LEXER_IDENT_LITERAL);
#if ENABLED (JERRY_ESNEXT)
if (context_p->token.keyword_type == LEXER_KEYW_LET
&& token_type != LEXER_KEYW_VAR)
{
parser_raise_error (context_p, PARSER_ERR_LEXICAL_LET_BINDING);
}
#endif /* ENABLED (JERRY_ESNEXT) */
JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
&& context_p->token.lit_location.type == LEXER_IDENT_LITERAL);