Declaration in the head of a for-of loop can't have an initializer (#4804)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka robert.sipka@h-lab.eu Co-authored-by: Robert Sipka <robert.sipka@h-lab.eu>
This commit is contained in:
@@ -1414,7 +1414,7 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
|
||||
if (context_p->token.type == LEXER_ASSIGN)
|
||||
{
|
||||
#if JERRY_ESNEXT
|
||||
if (context_p->status_flags & PARSER_IS_STRICT)
|
||||
if ((context_p->status_flags & PARSER_IS_STRICT) || !is_for_in)
|
||||
{
|
||||
parser_raise_error (context_p, PARSER_ERR_FOR_IN_OF_DECLARATION);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user