var-ary-ptrn-elem-ary-elem-iter.js (1898B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case 3 // - src/dstr-binding/default/for-var.template 4 /*--- 5 description: BindingElement with array binding pattern and initializer is not used (for statement) 6 esid: sec-for-statement-runtime-semantics-labelledevaluation 7 features: [destructuring-binding] 8 flags: [generated] 9 info: | 10 IterationStatement : 11 for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement 12 13 1. Let varDcl be the result of evaluating VariableDeclarationList. 14 [...] 15 16 13.3.2.4 Runtime Semantics: Evaluation 17 18 VariableDeclarationList : VariableDeclarationList , VariableDeclaration 19 20 1. Let next be the result of evaluating VariableDeclarationList. 21 2. ReturnIfAbrupt(next). 22 3. Return the result of evaluating VariableDeclaration. 23 24 VariableDeclaration : BindingPattern Initializer 25 26 1. Let rhs be the result of evaluating Initializer. 27 2. Let rval be GetValue(rhs). 28 3. ReturnIfAbrupt(rval). 29 4. Return the result of performing BindingInitialization for BindingPattern 30 passing rval and undefined as arguments. 31 32 13.3.3.6 Runtime Semantics: IteratorBindingInitialization 33 34 BindingElement : BindingPatternInitializer opt 35 36 1. If iteratorRecord.[[done]] is false, then 37 a. Let next be IteratorStep(iteratorRecord.[[iterator]]). 38 [...] 39 e. Else, 40 i. Let v be IteratorValue(next). 41 [...] 42 4. Return the result of performing BindingInitialization of BindingPattern 43 with v and environment as the arguments. 44 ---*/ 45 46 var iterCount = 0; 47 48 for (var [[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]; iterCount < 1; ) { 49 assert.sameValue(x, 7); 50 assert.sameValue(y, 8); 51 assert.sameValue(z, 9); 52 iterCount += 1; 53 } 54 55 assert.sameValue(iterCount, 1, 'Iteration occurred as expected'); 56 57 reportCompare(0, 0);