File tree Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -1414,7 +1414,7 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
1414
1414
if (context_p -> token .type == LEXER_ASSIGN )
1415
1415
{
1416
1416
#if JERRY_ESNEXT
1417
- if (context_p -> status_flags & PARSER_IS_STRICT )
1417
+ if (( context_p -> status_flags & PARSER_IS_STRICT ) || ! is_for_in )
1418
1418
{
1419
1419
parser_raise_error (context_p , PARSER_ERR_FOR_IN_OF_DECLARATION );
1420
1420
}
Original file line number Diff line number Diff line change
1
+ /* Copyright JS Foundation and other contributors, http://js.foundation
2
+ *
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+
16
+ function parse ( txt ) {
17
+ try {
18
+ eval ( txt )
19
+ assert ( false )
20
+ } catch ( e ) {
21
+ assert ( e instanceof SyntaxError )
22
+ }
23
+ }
24
+
25
+ parse ( "for (var x = 1 of []) { }" )
Original file line number Diff line number Diff line change 343
343
<test id="language/statements/for-of/cptn-expr-abrupt-empty.js"><reason></reason></test>
344
344
<test id="language/statements/for-of/cptn-expr-itr.js"><reason></reason></test>
345
345
<test id="language/statements/for-of/cptn-expr-no-itr.js"><reason></reason></test>
346
- <test id="language/statements/for-of/head-const-init.js"><reason></reason></test>
347
346
<test id="language/statements/for-of/head-decl-no-expr.js"><reason></reason></test>
348
347
<test id="language/statements/for-of/head-expr-no-expr.js"><reason></reason></test>
349
- <test id="language/statements/for-of/head-let-init.js"><reason></reason></test>
350
- <test id="language/statements/for-of/head-var-init.js"><reason></reason></test>
351
348
<test id="language/statements/for-of/head-var-no-expr.js"><reason></reason></test>
352
349
<test id="language/statements/for-of/let-block-with-newline.js"><reason></reason></test>
353
350
<test id="language/statements/for-of/let-identifier-with-newline.js"><reason></reason></test>
7702
7699
<test id="language/statements/for-await-of/async-gen-dstr-var-obj-ptrn-prop-id-get-value-err.js"><reason></reason></test>
7703
7700
<test id="language/statements/for-await-of/async-gen-dstr-var-obj-ptrn-prop-id-init-throws.js"><reason></reason></test>
7704
7701
<test id="language/statements/for-await-of/async-gen-dstr-var-obj-ptrn-prop-id-init-unresolvable.js"><reason></reason></test>
7705
- <test id="language/statements/for-await-of/head-const-init.js"><reason></reason></test>
7706
- <test id="language/statements/for-await-of/head-let-init.js"><reason></reason></test>
7707
- <test id="language/statements/for-await-of/head-var-init.js"><reason></reason></test>
7708
7702
<test id="language/statements/for-await-of/let-block-with-newline.js"><reason></reason></test>
7709
7703
<test id="language/statements/for-await-of/let-identifier-with-newline.js"><reason></reason></test>
7710
7704
<test id="language/statements/for-await-of/ticks-with-sync-iter-resolved-promise-and-constructor-lookup.js"><reason></reason></test>
You can’t perform that action at this time.
0 commit comments