aboutsummaryrefslogtreecommitdiffstats
path: root/src/dstr-assignment/obj-rest-to-property.case
blob: 3cfc221b699b1714039cb0e3791925111d3178a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2017 Caio Lima. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: >
    When DestructuringAssignmentTarget is an object property, its value should be binded
    as rest object.
template: default
esid: pending
includes: [propertyHelper.js]
features: [object-rest]
---*/

//- setup
var src = {};
//- elems
{...src.y}
//- vals
{ x: 1, y: 2}
//- body
assert.sameValue(src.y.x, 1);
assert.sameValue(src.y.y, 2);

verifyProperty(src, "y", {
  enumerable: true,
  writable: true,
  configurable: true
});