mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
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:
parent
6a995e2887
commit
7ea0000ee0
@ -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)
|
||||
|
||||
16
tests/jerry/es.next/for-of-statement-head.js
Normal file
16
tests/jerry/es.next/for-of-statement-head.js
Normal 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]) {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user