summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/spread-call-evaluation-order.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/spread-call-evaluation-order.js')
-rw-r--r--js/src/jit-test/tests/basic/spread-call-evaluation-order.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/spread-call-evaluation-order.js b/js/src/jit-test/tests/basic/spread-call-evaluation-order.js
new file mode 100644
index 000000000..2c2f53953
--- /dev/null
+++ b/js/src/jit-test/tests/basic/spread-call-evaluation-order.js
@@ -0,0 +1,13 @@
+load(libdir + "eqArrayHelper.js");
+
+var check = [];
+function t(token) {
+ check.push(token);
+ return token;
+}
+let f = (...x) => x;
+f(3, ...[t(1)], ...[t(2), t(3)], 34, 42, ...[t(4)]);
+assertEqArray(check, [1, 2, 3, 4]);
+
+var arr = [1, 2, 3];
+assertEqArray(f(...arr, arr.pop()), [1, 2, 3, 3]);