From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- js/src/tests/non262/Temporal/TimeZone/browser.js | 0 .../getPossibleInstantsFor-returns-dead-proxy.js | 21 +++++++++++++++++++++ js/src/tests/non262/Temporal/TimeZone/shell.js | 0 js/src/tests/non262/Temporal/browser.js | 0 js/src/tests/non262/Temporal/shell.js | 0 5 files changed, 21 insertions(+) create mode 100644 js/src/tests/non262/Temporal/TimeZone/browser.js create mode 100644 js/src/tests/non262/Temporal/TimeZone/getPossibleInstantsFor-returns-dead-proxy.js create mode 100644 js/src/tests/non262/Temporal/TimeZone/shell.js create mode 100644 js/src/tests/non262/Temporal/browser.js create mode 100644 js/src/tests/non262/Temporal/shell.js (limited to 'js/src/tests/non262/Temporal') diff --git a/js/src/tests/non262/Temporal/TimeZone/browser.js b/js/src/tests/non262/Temporal/TimeZone/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/non262/Temporal/TimeZone/getPossibleInstantsFor-returns-dead-proxy.js b/js/src/tests/non262/Temporal/TimeZone/getPossibleInstantsFor-returns-dead-proxy.js new file mode 100644 index 0000000000..0af1889bea --- /dev/null +++ b/js/src/tests/non262/Temporal/TimeZone/getPossibleInstantsFor-returns-dead-proxy.js @@ -0,0 +1,21 @@ +// |reftest| skip-if(!this.hasOwnProperty("Temporal")||!xulRuntime.shell) + +var g = newGlobal({newCompartment: true}); + +var tz = new class extends Temporal.TimeZone { + *getPossibleInstantsFor() { + // Return an Instant from a different compartment. + yield new g.Temporal.Instant(0n); + + // Turn the CCW into a dead proxy wrapper. + nukeAllCCWs(); + } +}("UTC"); + +var dt = new Temporal.PlainDateTime(2000, 1, 1); + +// Throws a TypeError when attempting to unwrap the dead proxy. +assertThrowsInstanceOf(() => dt.toZonedDateTime(tz), TypeError); + +if (typeof reportCompare === "function") + reportCompare(true, true); diff --git a/js/src/tests/non262/Temporal/TimeZone/shell.js b/js/src/tests/non262/Temporal/TimeZone/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/non262/Temporal/browser.js b/js/src/tests/non262/Temporal/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/non262/Temporal/shell.js b/js/src/tests/non262/Temporal/shell.js new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3