2014-09-08 21:23:39 +02:00
|
|
|
// Copyright (C) 2014 André Bargull. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
info: Compound Assignment Operator calls PutValue(lref, v)
|
2015-02-10 22:01:39 +01:00
|
|
|
es5id: S11.13.2_A6.9_T1
|
2014-09-08 21:23:39 +02:00
|
|
|
description: >
|
|
|
|
Evaluating LeftHandSideExpression lref returns Reference type; Reference
|
|
|
|
base value is an environment record and environment record kind is
|
|
|
|
declarative environment record. PutValue(lref, v) uses the initially
|
|
|
|
created Reference even if a more local binding is available.
|
|
|
|
Check operator is "x &= y".
|
|
|
|
flags: [noStrict]
|
|
|
|
---*/
|
|
|
|
|
|
|
|
function testCompoundAssignment() {
|
|
|
|
var x = 5;
|
|
|
|
var innerX = (function() {
|
|
|
|
x &= (eval("var x = 2;"), 3);
|
|
|
|
return x;
|
|
|
|
})();
|
|
|
|
|
|
|
|
if (innerX !== 2) {
|
2021-07-28 22:48:39 +02:00
|
|
|
throw new Test262Error('#1: innerX === 2. Actual: ' + (innerX));
|
2014-09-08 21:23:39 +02:00
|
|
|
}
|
|
|
|
if (x !== 1) {
|
2021-07-28 22:48:39 +02:00
|
|
|
throw new Test262Error('#2: x === 1. Actual: ' + (x));
|
2014-09-08 21:23:39 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
testCompoundAssignment();
|