summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Temporal
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /js/src/tests/non262/Temporal
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/non262/Temporal')
-rw-r--r--js/src/tests/non262/Temporal/PlainDate/browser.js0
-rw-r--r--js/src/tests/non262/Temporal/PlainDate/from-with-modified-array-iterator-state.js22
-rw-r--r--js/src/tests/non262/Temporal/PlainDate/shell.js0
3 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/non262/Temporal/PlainDate/browser.js b/js/src/tests/non262/Temporal/PlainDate/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/non262/Temporal/PlainDate/browser.js
diff --git a/js/src/tests/non262/Temporal/PlainDate/from-with-modified-array-iterator-state.js b/js/src/tests/non262/Temporal/PlainDate/from-with-modified-array-iterator-state.js
new file mode 100644
index 0000000000..ac0febc1e6
--- /dev/null
+++ b/js/src/tests/non262/Temporal/PlainDate/from-with-modified-array-iterator-state.js
@@ -0,0 +1,22 @@
+// |reftest| skip-if(!this.hasOwnProperty("Temporal"))
+
+const ArrayIteratorPrototype = Object.getPrototypeOf([][Symbol.iterator]());
+
+// Modify the ArrayIteratorPrototype prototype chain to disable optimisations.
+Object.setPrototypeOf(ArrayIteratorPrototype, {});
+
+let calendar = new Temporal.Calendar("iso8601");
+
+let dateLike = {
+ calendar,
+ day: 1,
+ month: 1,
+ year: 0,
+};
+
+let result = Temporal.PlainDate.from(dateLike);
+
+assertEq(result.toString(), "0000-01-01");
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);
diff --git a/js/src/tests/non262/Temporal/PlainDate/shell.js b/js/src/tests/non262/Temporal/PlainDate/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/non262/Temporal/PlainDate/shell.js