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