aboutsummaryrefslogtreecommitdiffstats
path: root/src/dstr-assignment-for-await/obj-rest-getter.case
blob: 0b020d847ff9a1756a2f9fc358eed2be182f1132 (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
29
30
31
32
33
// Copyright (C) 2017 Caio Lima & the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: >
    Getter is called when obj is being deconstructed to a rest Object
template: default
esid: pending
includes: [propertyHelper.js]
features: [object-rest]
---*/

//- setup
let x;
let count = 0;
//- elems
{...x}
//- vals
{ get v() { count++; return 2; } }
//- body
assert.sameValue(count, 1);

verifyProperty(x, "v", {
  enumerable: true,
  writable: true,
  configurable: true,
  value: 2
});

//- teardown
promise
  .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
  .then($DONE, $DONE);