| 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: Operator x++ calls PutValue(lhs, newValue) |
| 6 |
es5id: S11.3.1_A5_T3 |
| 7 |
description: > |
| 8 |
Evaluating LeftHandSideExpression lhs returns Reference type; Reference |
| 9 |
base value is an environment record and environment record kind is |
| 10 |
object environment record. PutValue(lhs, newValue) 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 = { |
| 17 |
x: 0 |
| 18 |
}; |
| 19 |
var innerScope = { |
| 20 |
get x() { |
| 21 |
delete this.x; |
| 22 |
return 2; |
| 23 |
} |
| 24 |
}; |
| 25 |
|
| 26 |
with (outerScope) { |
| 27 |
with (innerScope) { |
| 28 |
x++; |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
if (innerScope.x !== 3) { |
| 33 |
$ERROR('#1: innerScope.x === 3. Actual: ' + (innerScope.x)); |
| 34 |
} |
| 35 |
if (outerScope.x !== 0) { |
| 36 |
$ERROR('#2: outerScope.x === 0. Actual: ' + (outerScope.x)); |
| 37 |
} |