ary-ptrn-elem-id-init-hole.js (1180B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/ary-ptrn-elem-id-init-hole.case 3 // - src/dstr-binding/default/try.template 4 /*--- 5 description: Destructuring initializer with a "hole" (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 SingleNameBinding : BindingIdentifier Initializeropt 19 [...] 6. If Initializer is present and v is undefined, then 20 a. Let defaultValue be the result of evaluating Initializer. 21 b. Let v be GetValue(defaultValue). 22 [...] 23 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v). 24 ---*/ 25 26 var ranCatch = false; 27 28 try { 29 throw [,]; 30 } catch ([x = 23]) { 31 assert.sameValue(x, 23); 32 // another statement 33 ranCatch = true; 34 } 35 36 assert(ranCatch, 'executed `catch` block'); 37 38 reportCompare(0, 0);