obj-ptrn-rest-skip-non-enumerable.js (1134B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case 3 // - src/dstr-binding/default/try.template 4 /*--- 5 description: Rest object doesn't contain non-enumerable properties (try statement) 6 esid: sec-runtime-semantics-catchclauseevaluation 7 features: [object-rest, destructuring-binding] 8 flags: [generated] 9 includes: [propertyHelper.js] 10 info: | 11 Catch : catch ( CatchParameter ) Block 12 13 [...] 14 5. Let status be the result of performing BindingInitialization for 15 CatchParameter passing thrownValue and catchEnv as arguments. 16 [...] 17 ---*/ 18 var o = {a: 3, b: 4}; 19 Object.defineProperty(o, "x", { value: 4, enumerable: false }); 20 21 var ranCatch = false; 22 23 try { 24 throw o; 25 } catch ({...rest}) { 26 assert.sameValue(rest.x, undefined); 27 28 verifyProperty(rest, "a", { 29 enumerable: true, 30 writable: true, 31 configurable: true, 32 value: 3 33 }); 34 35 verifyProperty(rest, "b", { 36 enumerable: true, 37 writable: true, 38 configurable: true, 39 value: 4 40 }); 41 ranCatch = true; 42 } 43 44 assert(ranCatch, 'executed `catch` block'); 45 46 reportCompare(0, 0);