summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/compound-assignment/S11.13.2_A6.6_T1.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/expressions/compound-assignment/S11.13.2_A6.6_T1.js')
-rw-r--r--js/src/tests/test262/language/expressions/compound-assignment/S11.13.2_A6.6_T1.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/compound-assignment/S11.13.2_A6.6_T1.js b/js/src/tests/test262/language/expressions/compound-assignment/S11.13.2_A6.6_T1.js
new file mode 100644
index 0000000000..6590243878
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/compound-assignment/S11.13.2_A6.6_T1.js
@@ -0,0 +1,32 @@
+// 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)
+es5id: S11.13.2_A6.6_T1
+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 = 1;
+ var innerX = (function() {
+ x <<= (eval("var x = 2;"), 3);
+ return x;
+ })();
+
+ if (innerX !== 2) {
+ throw new Test262Error('#1: innerX === 2. Actual: ' + (innerX));
+ }
+ if (x !== 8) {
+ throw new Test262Error('#2: x === 8. Actual: ' + (x));
+ }
+}
+testCompoundAssignment();
+
+reportCompare(0, 0);