summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Array/slice-sparse-with-large-index.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/Array/slice-sparse-with-large-index.js')
-rw-r--r--js/src/tests/non262/Array/slice-sparse-with-large-index.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/tests/non262/Array/slice-sparse-with-large-index.js b/js/src/tests/non262/Array/slice-sparse-with-large-index.js
new file mode 100644
index 0000000000..7fcf571e53
--- /dev/null
+++ b/js/src/tests/non262/Array/slice-sparse-with-large-index.js
@@ -0,0 +1,18 @@
+var array = [];
+array[2**31 - 2] = "INT32_MAX - 1";
+array[2**31 - 1] = "INT32_MAX";
+array[2**31 - 0] = "INT32_MAX + 1";
+array[2**32 - 2] = "UINT32_MAX - 1";
+array[2**32 - 1] = "UINT32_MAX";
+array[2**32 - 0] = "UINT32_MAX + 1";
+
+var copy = array.slice();
+assertEq(copy[2**31 - 2], "INT32_MAX - 1");
+assertEq(copy[2**31 - 1], "INT32_MAX");
+assertEq(copy[2**31 - 0], "INT32_MAX + 1");
+assertEq(copy[2**32 - 2], "UINT32_MAX - 1");
+assertEq(copy[2**32 - 1], undefined);
+assertEq(copy[2**32 - 0], undefined);
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);