Debian Codegraph @

js/src/tests/test262/language/statements/variable/dstr/obj-ptrn-rest-skip-non-enumerable.js

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