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