summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Array/slice-sparse-with-large-index.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /js/src/tests/non262/Array/slice-sparse-with-large-index.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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);