summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/closures/lambdafc.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/closures/lambdafc.js')
-rw-r--r--js/src/jit-test/tests/closures/lambdafc.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/closures/lambdafc.js b/js/src/jit-test/tests/closures/lambdafc.js
new file mode 100644
index 000000000..03fc5ed2c
--- /dev/null
+++ b/js/src/jit-test/tests/closures/lambdafc.js
@@ -0,0 +1,25 @@
+actual = '';
+expected = '99,';
+
+function g(p) {
+ appendToActual(p());
+}
+
+function d(k) {
+ return function() { return k; }
+}
+
+function f(k) {
+ var p;
+
+ for (var i = 0; i < 1000; ++i) {
+ p = d(k);
+ }
+
+ g(p);
+}
+
+f(99);
+
+
+assertEq(actual, expected)