Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/assignment/dstr-obj-prop-put-prop-ref-no-get.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-assignment/obj-prop-put-prop-ref-no-get.case
3 // - src/dstr-assignment/default/assignment-expr.template
4 /*---
5 description: If the DestructuringAssignmentTarget of an AssignmentElement is a PropertyReference, it should not be evaluated. (AssignmentExpression)
6 esid: sec-variable-statement-runtime-semantics-evaluation
7 es6id: 13.3.2.4
8 features: [destructuring-binding]
9 flags: [generated]
10 info: |
11 VariableDeclaration : BindingPattern Initializer
12
13 1. Let rhs be the result of evaluating Initializer.
14 2. Let rval be GetValue(rhs).
15 3. ReturnIfAbrupt(rval).
16 4. Return the result of performing BindingInitialization for
17 BindingPattern passing rval and undefined as arguments.
18 ---*/
19 var setValue;
20 var x = {
21 get y() {
22 $ERROR('The property should not be accessed.');
23 },
24 set y(val) {
25 setValue = val;
26 }
27 };
28
29 var result;
30 var vals = { a: 23 };
31
32 result = { a: x.y } = vals;
33
34 assert.sameValue(setValue, 23);
35
36 assert.sameValue(result, vals);