Bug 1543642 - Part 4: Remove special-casing for Etc/UCT. r=jwalden
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 23 Apr 2019 16:45:55 +0200
changeset 530904 e32ac71686c8942b43d2c7189c649c88b8145d10
parent 530903 7375a89e0c85113ab3abbf23d7b028635b103195
child 530905 6bfd3a158f0f5b221ecf73b2fbbef8bca8b52836
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1543642
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1543642 - Part 4: Remove special-casing for Etc/UCT. r=jwalden Etc/UCT resp. UCT is a link to Etc/UTC starting with tzdata 2019a. Differential Revision: https://phabricator.services.mozilla.com//D27353
js/src/builtin/intl/DateTimeFormat.js
js/src/tests/non262/Intl/DateTimeFormat/timeZone.js
js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js
--- a/js/src/builtin/intl/DateTimeFormat.js
+++ b/js/src/builtin/intl/DateTimeFormat.js
@@ -216,22 +216,17 @@ function CanonicalizeTimeZoneName(timeZo
 
     // Step 2.
     var ianaTimeZone = intl_canonicalizeTimeZone(timeZone);
     assert(ianaTimeZone !== "Etc/Unknown", "Invalid canonical time zone");
     assert(ianaTimeZone === intl_IsValidTimeZoneName(ianaTimeZone), "Unsupported canonical time zone");
 
     // Step 3.
     if (ianaTimeZone === "Etc/UTC" || ianaTimeZone === "Etc/GMT") {
-        // ICU/CLDR canonicalizes Etc/UCT to Etc/GMT, but following IANA and
-        // ECMA-402 to the letter means Etc/UCT is a separate time zone.
-        if (timeZone === "Etc/UCT" || timeZone === "UCT")
-            ianaTimeZone = "Etc/UCT";
-        else
-            ianaTimeZone = "UTC";
+        ianaTimeZone = "UTC";
     }
 
     // Step 4.
     return ianaTimeZone;
 }
 
 var timeZoneCache = {
     icuDefaultTimeZone: undefined,
--- a/js/src/tests/non262/Intl/DateTimeFormat/timeZone.js
+++ b/js/src/tests/non262/Intl/DateTimeFormat/timeZone.js
@@ -16,40 +16,27 @@ const utcTimeZones = [
 
     // Links to Etc/UTC. (tzdata/etcetera)
     "Etc/Universal", "Etc/Zulu",
 
     // Links to Etc/GMT. (tzdata/backward)
     "GMT+0", "GMT-0", "GMT0", "Greenwich",
 
     // Links to Etc/UTC. (tzdata/backward)
-    "UTC", "Universal", "Zulu",
+    "UTC", "Universal", "Zulu", "Etc/UCT", "UCT",
 ];
 
 for (let timeZone of utcTimeZones) {
     for (let map of tzMapper) {
         let dtf = new Intl.DateTimeFormat(undefined, {timeZone: map(timeZone)});
         assertEq(dtf.resolvedOptions().timeZone, "UTC");
     }
 }
 
 
-// ECMA-402 doesn't normalize Etc/UCT to UTC.
-const uctTimeZones = [
-    "Etc/UCT", "UCT",
-];
-
-for (let timeZone of uctTimeZones) {
-    for (let map of tzMapper) {
-        let dtf = new Intl.DateTimeFormat(undefined, {timeZone: map(timeZone)});
-        assertEq(dtf.resolvedOptions().timeZone, "Etc/UCT");
-    }
-}
-
-
 const invalidTimeZones = [
     "", "null", "undefined", "UTC\0",
 
     // ICU time zone name for invalid time zones.
     "Etc/Unknown",
 
     // ICU custom time zones.
     "GMT-1", "GMT+1", "GMT-10", "GMT+10",
--- a/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js
+++ b/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js
@@ -46,17 +46,17 @@ const timeZones = [
     { id: "PST8PDT" },
     // ICU on non-Windows platforms doesn't accept these three time zone
     // identifiers, cf. isValidOlsonID in $ICU/source/common/putil.cpp. We
     // could add support for them, but it seems unlikely they're used in
     // practice, so we just skip over them.
     // { id: "GMT+0", normalized: "UTC" },
     // { id: "GMT-0", normalized: "UTC" },
     // { id: "GMT0", normalized: "UTC" },
-    { id: "UCT", normalized: "Etc/UCT" },
+    { id: "UCT", normalized: "UTC" },
     { id: "UTC", normalized: "UTC" },
     { id: "GMT", normalized: "UTC" },
 ];
 
 for (let {id, normalized = id} of timeZones) {
     inTimeZone(id, () => {
         let opts = new Intl.DateTimeFormat().resolvedOptions();
         assertEq(opts.timeZone, normalized);