array-rest-init.js (1199B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/dstr-assignment/array-rest-init.case 4 // - src/dstr-assignment/syntax/for-in.template 5 /*--- 6 description: The AssignmentRestElement does not support an initializer. (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 var x; 33 34 for ([...x = 1] in [[]]) ;