| 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.7_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, v) 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 |
Check operator is "x >>= y". |
| 14 |
flags: [noStrict] |
| 15 |
---*/ |
| 16 |
|
| 17 |
var outerScope = { |
| 18 |
x: 0 |
| 19 |
}; |
| 20 |
var innerScope = { |
| 21 |
get x() { |
| 22 |
delete this.x; |
| 23 |
return 16; |
| 24 |
} |
| 25 |
}; |
| 26 |
|
| 27 |
with (outerScope) { |
| 28 |
with (innerScope) { |
| 29 |
x >>= 3; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
if (innerScope.x !== 2) { |
| 34 |
$ERROR('#1: innerScope.x === 2. Actual: ' + (innerScope.x)); |
| 35 |
} |
| 36 |
if (outerScope.x !== 0) { |
| 37 |
$ERROR('#2: outerScope.x === 0. Actual: ' + (outerScope.x)); |
| 38 |
} |