summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testWithAndShadowing.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testWithAndShadowing.js')
-rw-r--r--js/src/jit-test/tests/basic/testWithAndShadowing.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testWithAndShadowing.js b/js/src/jit-test/tests/basic/testWithAndShadowing.js
new file mode 100644
index 0000000000..07922c8993
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testWithAndShadowing.js
@@ -0,0 +1,14 @@
+// see bug 470795
+var o = [{},{},{i:42}]
+var i;
+var s = [];
+for (var j = 0; j < 3; ++j) {
+ with (o[j]) {
+ for (i = 0; i < 2; ++i) {
+ s.push(j);
+ s.push(i);
+ }
+ }
+}
+assertEq(s.join(), '0,0,0,1,1,0,1,1,2,0,2,1');
+