summaryrefslogtreecommitdiff
path: root/src/spread/obj-getter-init.case
blob: aa6e672140ef4294a73ede9107a5b302ee990965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2017 Caio Lima. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Getter in object literal is not evaluated
template: default
esid: pending
features: [object-spread]
---*/

//- setup

let o = {a: 2, b: 3};
let executedGetter = false;

//- args
{...o, get c() { executedGetter = true; }}
//- params
obj
//- body
assert.sameValue(obj.a, 2);
assert.sameValue(obj.b, 3);
assert.sameValue(executedGetter, false)
assert.sameValue(Object.keys(obj).length, 3);