From 575a974d4278d8531ad32d11f9b593a98d45bbb4 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Tue, 3 Dec 2024 17:30:58 -0800 Subject: [PATCH] Update UTC time zone canonicalization to match proposal-canonical-tz The test for https://github.com/tc39/ecma402/pull/724 (added in https://github.com/tc39/test262/pull/4328) didn't take the Time Zone Canonicalization proposal into account; but it should, because that proposal is stage 3. As of that proposal, the [[TimeZone]] slot of DateTimeFormat gets the case-regularized original identifier, no longer the primary identifier. So the resolvedOptions().timeZone property also no longer returns the primary identifier. --- test/intl402/DateTimeFormat/canonicalize-utc-timezone.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/intl402/DateTimeFormat/canonicalize-utc-timezone.js b/test/intl402/DateTimeFormat/canonicalize-utc-timezone.js index 48fce06169..d4b70431ac 100644 --- a/test/intl402/DateTimeFormat/canonicalize-utc-timezone.js +++ b/test/intl402/DateTimeFormat/canonicalize-utc-timezone.js @@ -17,10 +17,13 @@ info: | 5. For each element identifier of identifiers, do ... c. If primary is one of "Etc/UTC", "Etc/GMT", or "GMT", set primary to "UTC". +features: [Temporal] ---*/ const utcIdentifiers = ["Etc/GMT", "Etc/UTC", "GMT"]; for (const timeZone of utcIdentifiers) { - assert.sameValue(new Intl.DateTimeFormat([], {timeZone}).resolvedOptions().timeZone, "UTC", "Time zone name " + timeZone + " not canonicalized to 'UTC'."); + const dateTime = new Temporal.ZonedDateTime(0n, timeZone); + const utcDateTime = new Temporal.ZonedDateTime(0n, "UTC"); + assert(dateTime.equals(utcDateTime), "Time zone name " + timeZone + " should be equal to primary identifier 'UTC'."); }