summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testMoreClosures.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testMoreClosures.js')
-rw-r--r--js/src/jit-test/tests/basic/testMoreClosures.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testMoreClosures.js b/js/src/jit-test/tests/basic/testMoreClosures.js
new file mode 100644
index 000000000..5592bcba3
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testMoreClosures.js
@@ -0,0 +1,14 @@
+function testMoreClosures() {
+ var f = {}, max = 3;
+
+ var hello = function(n) {
+ function howdy() { return n * n }
+ f.test = howdy;
+ };
+
+ for (var i = 0; i <= max; i++)
+ hello(i);
+
+ return f.test();
+}
+assertEq(testMoreClosures(), 9);