Revision control

Copy as Markdown

// 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: >
When DestructuringAssignmentTarget is an object property setter, its value should be
binded as rest object.
template: default
esid: pending
features: [object-rest]
---*/
//- setup
let settedValue;
let executedGetter = false;
let src = {
get y() {
executedGetter = true;
},
set y(v) {
settedValue = v;
},
};
src.y = undefined;
//- elems
{...src.y}
//- vals
{ x: 1, y: 2}
//- body
assert.sameValue(settedValue.x, 1);
assert.sameValue(settedValue.y, 2);
assert(!executedGetter, "The property should not be accessed");
//- teardown
promise
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
.then($DONE, $DONE);