summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/closure-01.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/jaeger/closure-01.js')
-rw-r--r--js/src/jit-test/tests/jaeger/closure-01.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/jaeger/closure-01.js b/js/src/jit-test/tests/jaeger/closure-01.js
new file mode 100644
index 0000000000..4c82b6fd35
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/closure-01.js
@@ -0,0 +1,18 @@
+
+/* Non-reentrant call on an inner and outer closure. */
+
+function foo() {
+ var x = 0;
+ function bar() {
+ var y = 0;
+ function baz() {
+ return ++x + ++y;
+ }
+ return baz;
+ }
+ return bar();
+}
+
+var a = foo();
+var b = foo();
+assertEq(a() + a() + b() + b(), 12);