Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/assignment/S11.13.1_A5_T4.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: Assignment Operator calls PutValue(lref, rval)
6 es5id: S11.13.1_A5_T4
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, rval) uses the initially
11 created Reference even if the environment binding is no longer present.
12 No ReferenceError is thrown when assignment is in strict-mode code and the
13 original binding is no longer present.
14 flags: [noStrict]
15 ---*/
16
17 var scope = {x: 1};
18
19 with (scope) {
20 (function() {
21 "use strict";
22 x = (delete scope.x, 2);
23 })();
24 }
25
26 if (scope.x !== 2) {
27 $ERROR('#1: scope.x === 2. Actual: ' + (scope.x));
28 }