summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/saved-stacks/shared-parent-frames.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/saved-stacks/shared-parent-frames.js')
-rw-r--r--js/src/jit-test/tests/saved-stacks/shared-parent-frames.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/saved-stacks/shared-parent-frames.js b/js/src/jit-test/tests/saved-stacks/shared-parent-frames.js
new file mode 100644
index 0000000000..c6b4332dd9
--- /dev/null
+++ b/js/src/jit-test/tests/saved-stacks/shared-parent-frames.js
@@ -0,0 +1,19 @@
+// Test that parent frames are shared when the older portions of two stacks are
+// the same.
+
+let f1, f2;
+
+function dos() {
+ f1 = saveStack();
+ f2 = saveStack();
+}
+
+(function uno() {
+ dos();
+}());
+
+
+// Different youngest frames.
+assertEq(f1 == f2, false);
+// However the parents should be the same.
+assertEq(f1.parent, f2.parent);