| 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_T3 |
| 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 |
Binding in surrounding object environment record is not changed. |
| 13 |
flags: [noStrict] |
| 14 |
---*/ |
| 15 |
|
| 16 |
var outerScope = {x: 0}; |
| 17 |
var innerScope = {x: 1}; |
| 18 |
|
| 19 |
with (outerScope) { |
| 20 |
with (innerScope) { |
| 21 |
x = (delete innerScope.x, 2); |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
if (innerScope.x !== 2) { |
| 26 |
$ERROR('#1: innerScope.x === 2. Actual: ' + (innerScope.x)); |
| 27 |
} |
| 28 |
if (outerScope.x !== 0) { |
| 29 |
$ERROR('#2: outerScope.x === 0. Actual: ' + (outerScope.x)); |
| 30 |
} |