Debian Codegraph @

js/src/tests/test262/language/statements/for-await-of/head-var-init.js

raw
1 // |reftest| error:SyntaxError
2 // Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-iteration-statements
6 description: >
7 Initializer is not allowed in head's ForBinding position.
8 info: |
9 IterationStatement:
10 for await (var ForBinding of AssignmentExpression) Statement
11 negative:
12 phase: parse
13 type: SyntaxError
14 features: [async-iteration]
15 ---*/
16
17 $DONOTEVALUATE();
18
19 async function fn() {
20 for await (var x = 1 of []) {}
21 }