Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/compound-assignment/S11.13.2_A5.9_T5.js

raw
1 // Copyright (C) 2014 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: Compound Assignment Operator calls PutValue(lref, v)
6 es5id: S11.13.2_A5.9_T5
7 description: >
8 Evaluating LeftHandSideExpression lref returns Reference type; Reference
9 base value is an environment record and environment record kind is
10 object environment record. PutValue(lref, v) uses the initially
11 created Reference even if the environment binding is no longer present.
12 No ReferenceError is thrown when 'x &= y' is in strict-mode code and the
13 original binding is no longer present.
14 Check operator is "x &= y".
15 ---*/
16
17 Object.defineProperty(this, "x", {
18 configurable: true,
19 get: function() {
20 delete this.x;
21 return 5;
22 }
23 });
24
25 (function() {
26 "use strict";
27 x &= 3;
28 })();
29
30 if (this.x !== 1) {
31 $ERROR('#1: this.x === 1. Actual: ' + (this.x));
32 }