ary-ptrn-elem-id-iter-val.js (1573B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/ary-ptrn-elem-id-iter-val.case 3 // - src/dstr-binding/default/try.template 4 /*--- 5 description: SingleNameBinding when value iteration was completed previously (try statement) 6 esid: sec-runtime-semantics-catchclauseevaluation 7 features: [destructuring-binding] 8 flags: [generated] 9 info: | 10 Catch : catch ( CatchParameter ) Block 11 12 [...] 13 5. Let status be the result of performing BindingInitialization for 14 CatchParameter passing thrownValue and catchEnv as arguments. 15 [...] 16 17 13.3.3.6 Runtime Semantics: IteratorBindingInitialization 18 19 SingleNameBinding : BindingIdentifier Initializeropt 20 21 [...] 22 4. If iteratorRecord.[[done]] is false, then 23 a. Let next be IteratorStep(iteratorRecord.[[iterator]]). 24 b. If next is an abrupt completion, set iteratorRecord.[[done]] to true. 25 c. ReturnIfAbrupt(next). 26 d. If next is false, set iteratorRecord.[[done]] to true. 27 e. Else, 28 [...] 29 i. Let v be IteratorValue(next). 30 ii. If v is an abrupt completion, set 31 iteratorRecord.[[done]] to true. 32 iii. ReturnIfAbrupt(v). 33 5. If iteratorRecord.[[done]] is true, let v be undefined. 34 [...] 35 8. Return InitializeReferencedBinding(lhs, v). 36 ---*/ 37 38 var ranCatch = false; 39 40 try { 41 throw [1, 2, 3]; 42 } catch ([x, y, z]) { 43 assert.sameValue(x, 1); 44 assert.sameValue(y, 2); 45 assert.sameValue(z, 3); 46 ranCatch = true; 47 } 48 49 assert(ranCatch, 'executed `catch` block'); 50 51 reportCompare(0, 0);