ary-ptrn-rest-id-exhausted.js (1269B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/ary-ptrn-rest-id-exhausted.case 3 // - src/dstr-binding/default/try.template 4 /*--- 5 description: RestElement applied to an exhausted iterator (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 BindingRestElement : ... BindingIdentifier 19 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier, 20 environment). 21 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat, 22 [...] 23 b. If iteratorRecord.[[done]] is true, then 24 i. If environment is undefined, return PutValue(lhs, A). 25 ii. Return InitializeReferencedBinding(lhs, A). 26 27 ---*/ 28 29 var ranCatch = false; 30 31 try { 32 throw [1, 2]; 33 } catch ([, , ...x]) { 34 assert(Array.isArray(x)); 35 assert.sameValue(x.length, 0); 36 ranCatch = true; 37 } 38 39 assert(ranCatch, 'executed `catch` block'); 40 41 reportCompare(0, 0);