summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/closures/nameinc-loop-2.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/closures/nameinc-loop-2.js')
-rw-r--r--js/src/jit-test/tests/closures/nameinc-loop-2.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/closures/nameinc-loop-2.js b/js/src/jit-test/tests/closures/nameinc-loop-2.js
new file mode 100644
index 0000000000..1753f26899
--- /dev/null
+++ b/js/src/jit-test/tests/closures/nameinc-loop-2.js
@@ -0,0 +1,26 @@
+actual = '';
+expected = '1,2,3,4,5,5,undefined,1,2,3,4,5,5,undefined,1,2,3,4,5,5,undefined,1,2,3,4,5,5,undefined,1,2,3,4,5,5,undefined,';
+
+var f = function() {
+ var p = 0;
+
+ function g() {
+ for (var i = 0; i < 5; ++i) {
+ p++;
+ appendToActual(p);
+ }
+ }
+
+ g();
+
+ appendToActual(p);
+}
+
+for (var i = 0; i < 5; ++i) {
+ f();
+ appendToActual();
+}
+
+
+
+assertEq(actual, expected)