test262/src/dstr-binding/obj-ptrn-rest-getter.case

27 lines
532 B
Plaintext

// Copyright (C) 2017 Caio Lima. 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
var count = 0;
//- elems
{...x}
//- vals
{ get v() { count++; return 2; } }
//- body
assert.sameValue(x.v, 2);
assert.sameValue(count, 1);
verifyEnumerable(x, "v");
verifyWritable(x, "v");
verifyConfigurable(x, "v");