obj-ptrn-rest-skip-non-enumerable.js (1183B)
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/let-stmt.template 4 /*--- 5 description: Rest object doesn't contain non-enumerable properties (`let` statement) 6 esid: sec-let-and-const-declarations-runtime-semantics-evaluation 7 features: [object-rest, destructuring-binding] 8 flags: [generated] 9 includes: [propertyHelper.js] 10 info: | 11 LexicalBinding : BindingPattern Initializer 12 13 1. Let rhs be the result of evaluating Initializer. 14 2. Let value be GetValue(rhs). 15 3. ReturnIfAbrupt(value). 16 4. Let env be the running execution context's LexicalEnvironment. 17 5. Return the result of performing BindingInitialization for BindingPattern 18 using value and env as the arguments. 19 ---*/ 20 var o = {a: 3, b: 4}; 21 Object.defineProperty(o, "x", { value: 4, enumerable: false }); 22 23 let {...rest} = o; 24 25 assert.sameValue(rest.x, undefined); 26 27 verifyProperty(rest, "a", { 28 enumerable: true, 29 writable: true, 30 configurable: true, 31 value: 3 32 }); 33 34 verifyProperty(rest, "b", { 35 enumerable: true, 36 writable: true, 37 configurable: true, 38 value: 4 39 }); 40 41 reportCompare(0, 0);