obj-ptrn-prop-ary-init.js (1299B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/obj-ptrn-prop-ary-init.case 3 // - src/dstr-binding/default/try.template 4 /*--- 5 description: Object binding pattern with "nested" array binding pattern using initializer (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.7 Runtime Semantics: KeyedBindingInitialization 18 19 [...] 20 3. If Initializer is present and v is undefined, then 21 a. Let defaultValue be the result of evaluating Initializer. 22 b. Let v be GetValue(defaultValue). 23 c. ReturnIfAbrupt(v). 24 4. Return the result of performing BindingInitialization for BindingPattern 25 passing v and environment as arguments. 26 ---*/ 27 28 var ranCatch = false; 29 30 try { 31 throw {}; 32 } catch ({ w: [x, y, z] = [4, 5, 6] }) { 33 assert.sameValue(x, 4); 34 assert.sameValue(y, 5); 35 assert.sameValue(z, 6); 36 37 assert.throws(ReferenceError, function() { 38 w; 39 }); 40 ranCatch = true; 41 } 42 43 assert(ranCatch, 'executed `catch` block'); 44 45 reportCompare(0, 0);