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