ary-ptrn-elem-id-iter-step-err.js (1198B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case 3 // - src/dstr-binding/error/try.template 4 /*--- 5 description: Error forwarding when IteratorStep returns an abrupt completion (try statement) 6 esid: sec-runtime-semantics-catchclauseevaluation 7 features: [Symbol.iterator, 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 27 ---*/ 28 var g = {}; 29 g[Symbol.iterator] = function() { 30 return { 31 next: function() { 32 throw new Test262Error(); 33 } 34 }; 35 }; 36 37 assert.throws(Test262Error, function() { 38 try { 39 throw g; 40 } catch ([x]) {} 41 }); 42 43 reportCompare(0, 0);