summaryrefslogtreecommitdiff
path: root/test/language/expressions/compound-assignment/S11.13.2_A6.4_T1.js
diff options
context:
space:
mode:
authorAndré Bargull <andre.bargull@gmail.com>2014-09-08 21:23:39 +0200
committerBrian Terlson <brian.terlson@microsoft.com>2014-12-10 16:05:32 -0800
commit0ceb428ec93cda5c63f470c0f9d5552441bbc32d (patch)
tree8f292f8afc1acb3f9faee9b74858f1cb99b8d0f4 /test/language/expressions/compound-assignment/S11.13.2_A6.4_T1.js
parent485059c46d6ce5001911f6900bb057d7f2ceaf49 (diff)
downloadqtdeclarative-testsuites-0ceb428ec93cda5c63f470c0f9d5552441bbc32d.tar.gz
Add test coverage for identifier resolution in dynamic scopes
Identifier resolution in dynamic scope context is missing test coverage, resolves https://bugs.ecmascript.org/show_bug.cgi?id=1751 .
Diffstat (limited to 'test/language/expressions/compound-assignment/S11.13.2_A6.4_T1.js')
-rwxr-xr-xtest/language/expressions/compound-assignment/S11.13.2_A6.4_T1.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/language/expressions/compound-assignment/S11.13.2_A6.4_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A6.4_T1.js
new file mode 100755
index 000000000..3bb0664ff
--- /dev/null
+++ b/test/language/expressions/compound-assignment/S11.13.2_A6.4_T1.js
@@ -0,0 +1,29 @@
+// 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)
+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 = 3;
+ var innerX = (function() {
+ x += (eval("var x = 2;"), 1);
+ return x;
+ })();
+
+ if (innerX !== 2) {
+ $ERROR('#1: innerX === 2. Actual: ' + (innerX));
+ }
+ if (x !== 4) {
+ $ERROR('#2: x === 4. Actual: ' + (x));
+ }
+}
+testCompoundAssignment();