Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/assignment/dstr-obj-rest-descriptors.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-assignment/obj-rest-descriptors.case
3 // - src/dstr-assignment/default/assignment-expr.template
4 /*---
5 description: Object created from rest deconstruction doesn't copy source object property descriptors. (AssignmentExpression)
6 esid: sec-variable-statement-runtime-semantics-evaluation
7 es6id: 13.3.2.4
8 features: [object-rest, destructuring-binding]
9 flags: [generated]
10 includes: [propertyHelper.js]
11 info: |
12 VariableDeclaration : BindingPattern Initializer
13
14 1. Let rhs be the result of evaluating Initializer.
15 2. Let rval be GetValue(rhs).
16 3. ReturnIfAbrupt(rval).
17 4. Return the result of performing BindingInitialization for
18 BindingPattern passing rval and undefined as arguments.
19 ---*/
20 var rest;
21 var obj = {};
22 Object.defineProperty(obj, "a", { value: 3, configurable: false, enumerable: true });
23 Object.defineProperty(obj, "b", { value: 4, writable: false, enumerable: true });
24
25 var result;
26 var vals = obj;
27
28 result = {...rest} = vals;
29
30 verifyProperty(rest, "a", {
31 enumerable: true,
32 writable: true,
33 configurable: true,
34 value: 3
35 });
36
37 verifyProperty(rest, "b", {
38 enumerable: true,
39 writable: true,
40 configurable: true,
41 value: 4
42 });
43
44
45 assert.sameValue(result, vals);