mirror of
https://github.com/tc39/test262.git
synced 2025-11-14 02:39:42 +01:00
35 lines
801 B
Plaintext
35 lines
801 B
Plaintext
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
desc: >
|
|
If the DestructuringAssignmentTarget of an AssignmentElement is a
|
|
PropertyReference, it should not be evaluated.
|
|
template: default
|
|
es6id: 12.14.5.3
|
|
---*/
|
|
|
|
//- setup
|
|
let setValue;
|
|
let x = {
|
|
get y() {
|
|
throw new Test262Error('The property should not be accessed.');
|
|
},
|
|
set y(val) {
|
|
setValue = val;
|
|
}
|
|
};
|
|
//- elems
|
|
[...x.y]
|
|
//- vals
|
|
[23, 45, 99]
|
|
//- body
|
|
assert.sameValue(setValue.length, 3);
|
|
assert.sameValue(setValue[0], 23);
|
|
assert.sameValue(setValue[1], 45);
|
|
assert.sameValue(setValue[2], 99);
|
|
//- teardown
|
|
promise
|
|
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
|
.then($DONE, $DONE);
|