summaryrefslogtreecommitdiff
path: root/src/dstr-assignment/obj-prop-put-prop-ref-no-get.case
blob: 2b5b83ec5f9bafdbe38699d9190ee68069cb7610 (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
// Copyright (C) 2015 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.4
---*/

//- setup
var setValue;
var x = {
  get y() {
    $ERROR('The property should not be accessed.');
  },
  set y(val) {
    setValue = val;
  }
};
//- elems
{ a: x.y }
//- vals
{ a: 23 }
//- body
assert.sameValue(setValue, 23);