Minor fix in for-of statement parsing (#4814)

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka robert.sipka@h-lab.eu
This commit is contained in:
Robert Sipka 2021-11-02 19:12:30 +01:00 committed by GitHub
parent 6a995e2887
commit 7ea0000ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -1289,7 +1289,7 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
#endif /* JERRY_ESNEXT */
lexer_next_token (context_p);
int options = is_for_in ? PARSE_EXPR : PARSE_EXPR_LEFT_HAND_SIDE;
int options = is_for_in ? PARSE_EXPR : PARSE_EXPR_NO_COMMA;
parser_parse_expression (context_p, options);
if (context_p->token.type != LEXER_RIGHT_PAREN)

View File

@ -0,0 +1,16 @@
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
for (a of [1] || [2]) {}