Debian Codegraph @

js/src/tests/test262/language/statements/for-await-of/async-func-decl-dstr-array-elem-nested-obj-invalid.js

raw
1 // |reftest| error:SyntaxError
2 // This file was procedurally generated from the following sources:
3 // - src/dstr-assignment-for-await/array-elem-nested-obj-invalid.case
4 // - src/dstr-assignment-for-await/error-async-function-syntax/async-func-decl.template
5 /*---
6 description: It is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral or an ArrayLiteral and if the lexical token sequence matched by LeftHandSideExpression cannot be parsed with no tokens left over using AssignmentPattern as the goal symbol. (for-await-of statement in an async function declaration)
7 esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
8 features: [destructuring-binding, async-iteration]
9 flags: [generated]
10 negative:
11 phase: parse
12 type: SyntaxError
13 info: |
14 IterationStatement :
15 for await ( LeftHandSideExpression of AssignmentExpression ) Statement
16
17 1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
18 AssignmentExpression, iterate).
19 2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
20 keyResult, assignment, labelSet).
21
22 13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
23
24 [...]
25 5. If destructuring is true and if lhsKind is assignment, then
26 a. Assert: lhs is a LeftHandSideExpression.
27 b. Let assignmentPattern be the parse of the source text corresponding to
28 lhs using AssignmentPattern as the goal symbol.
29 [...]
30 ---*/
31 $DONOTEVALUATE();
32
33 async function fn() {
34 for await ([{ get x() {} }] of [[{}]]) {}
35 }