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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user