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