obj-prop-nested-array-invalid.js (1406B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/dstr-assignment/obj-prop-nested-array-invalid.case 4 // - src/dstr-assignment/syntax/for-in.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..in statement) 7 esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation 8 features: [destructuring-binding] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 IterationStatement : 15 for ( 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 4. 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 for ({ x: [(x, y)] } in [{ x: [] }]) ;