ary-ptrn-rest-obj-prop-id.js (1390B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case 3 // - src/dstr-binding/default/try.template 4 /*--- 5 description: Rest element containing an object binding pattern (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 BindingRestElement : ... BindingPattern 20 21 1. Let A be ArrayCreate(0). 22 [...] 23 3. Repeat 24 [...] 25 b. If iteratorRecord.[[done]] is true, then 26 i. Return the result of performing BindingInitialization of 27 BindingPattern with A and environment as the arguments. 28 [...] 29 ---*/ 30 let length = "outer"; 31 32 var ranCatch = false; 33 34 try { 35 throw [7, 8, 9]; 36 } catch ([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) { 37 assert.sameValue(v, 7); 38 assert.sameValue(w, 8); 39 assert.sameValue(x, 9); 40 assert.sameValue(y, undefined); 41 assert.sameValue(z, 3); 42 43 assert.sameValue(length, "outer", "the length prop is not set as a binding name"); 44 ranCatch = true; 45 } 46 47 assert(ranCatch, 'executed `catch` block'); 48 49 reportCompare(0, 0);