summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/recover-spread-opt-arguments-after-bail.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/arguments/recover-spread-opt-arguments-after-bail.js')
-rw-r--r--js/src/jit-test/tests/arguments/recover-spread-opt-arguments-after-bail.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/arguments/recover-spread-opt-arguments-after-bail.js b/js/src/jit-test/tests/arguments/recover-spread-opt-arguments-after-bail.js
new file mode 100644
index 0000000000..c8c76c278a
--- /dev/null
+++ b/js/src/jit-test/tests/arguments/recover-spread-opt-arguments-after-bail.js
@@ -0,0 +1,22 @@
+function outer(fn, x, y) {
+ fn(...arguments);
+}
+
+function inner1(fn, x, y) {
+ assertEq(fn, inner1);
+ assertEq(x, y);
+}
+
+function inner2(fn, x, y) {
+ assertEq(fn, inner2);
+ assertEq(x, 100);
+ assertEq(y, 200);
+}
+
+for (let i = 0; i < 100; i++) {
+ outer(inner1, i, i);
+}
+
+// Call with a different function to cause a bailout. This will lead to
+// recovering the |arguments| object.
+outer(inner2, 100, 200);