From 8aeb28f49b8da9402b1ec820e469b1c61b28ee4a Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Sun, 1 Dec 2024 00:45:21 +0000 Subject: [PATCH] Bug 1930466 - Part 1: Use zone.tab to guide time zone canonicalisation. r=dminor Implement the changes from to reduce differences in time zone canonicalisation when compared to V8 and JSC (which both use CLDR time zone data instead of IANA time zone data). Implementing the `AvailableNamedTimeZoneIdentifiers` spec operation requires to link time zone identifiers to region codes. When the time zone is listed in the "zone.tab" file, we can get the region code from "zone.tab". In all other cases we need to manually map the time zone to a matching region, because CLDR doesn't have "public" data for this [1]. This is implemented using the new file "intl/TimeZoneMapping.yaml". ICU 74 added `ucal_getIanaTimeZoneID` to get the canonical IANA time zone id. Internally `ucal_getIanaTimeZoneID` first calls `ucal_getCanonicalTimeZoneID` and then loads a resource bundle to check if there are any time zone ids which need to be replaced with other ids for compatibility with IANA data. Unfortunately the resource bundle is not cached, so calling `ucal_getIanaTimeZoneID` instead of `ucal_getIanaTimeZoneID` adds a considerable performance overhead. To avoid any performance regressions, we keep our own time zone rewriting code for the time being. Using our own code also means we don't have to add a workaround for this CLDR bug: . Also remove "Factory" from the list of supported time zone identifiers, because supporting it was always a bit questionable and latest V8 also doesn't support it anymore, so we shouldn't run into web-compat issues. Remove the old generated tests and add "timeZone_links.js" to ensure time zone links are correctly resolved. [1] Neither of these two files look like "public" data to me: - https://github.com/unicode-org/cldr/blob/main/tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/TZID.txt - https://github.com/unicode-org/cldr/blob/main/tools/cldr-code/src/main/resources/org/unicode/cldr/icu/idList.txt Differential Revision: https://phabricator.services.mozilla.com/D228584 UltraBlame original commit: 880f2288640c43653f56bc919e9d16434426bf84 --- .../test/browser/browser_timezone.js | 36 +- js/src/builtin/intl/TimeZoneDataGenerated.h | 401 +- js/src/builtin/intl/TimeZoneMapping.yaml | 700 ++++ js/src/builtin/intl/make_intl_data.py | 3235 +++++++---------- .../tests/resist-fingerprinting/timezone.js | 4 +- .../Intl/DateTimeFormat/timeZone_backzone.js | 1538 -------- .../DateTimeFormat/timeZone_backzone_links.js | 292 -- ...ne_backward_links.js => timeZone_links.js} | 409 ++- .../timeZone_notbackward_links.js | 160 - .../DateTimeFormat/tz-environment-variable.js | 28 + .../supportedValuesOf-timeZones-canonical.js | 198 +- 11 files changed, 2709 insertions(+), 4292 deletions(-) create mode 100644 js/src/builtin/intl/TimeZoneMapping.yaml delete mode 100644 js/src/tests/non262/Intl/DateTimeFormat/timeZone_backzone.js delete mode 100644 js/src/tests/non262/Intl/DateTimeFormat/timeZone_backzone_links.js rename js/src/tests/non262/Intl/DateTimeFormat/{timeZone_backward_links.js => timeZone_links.js} (82%) delete mode 100644 js/src/tests/non262/Intl/DateTimeFormat/timeZone_notbackward_links.js diff --git a/browser/components/resistfingerprinting/test/browser/browser_timezone.js b/browser/components/resistfingerprinting/test/browser/browser_timezone.js index 20e9999c1319f..0ddd6ec26c1da 100644 --- a/browser/components/resistfingerprinting/test/browser/browser_timezone.js +++ b/browser/components/resistfingerprinting/test/browser/browser_timezone.js @@ -30,7 +30,9 @@ getJSTestingFunctions setTimeZone ( " -PST8PDT +America +/ +Los_Angeles " ) ; @@ -53,7 +55,9 @@ resolvedOptions . timeZone " -PST8PDT +America +/ +Los_Angeles " " Default @@ -721,7 +725,9 @@ getJSTestingFunctions setTimeZone ( " -PST8PDT +America +/ +Los_Angeles " ) ; @@ -744,7 +750,9 @@ resolvedOptions . timeZone " -PST8PDT +America +/ +Los_Angeles " " Default @@ -820,7 +828,9 @@ resolvedOptions . timeZone " -PST8PDT +America +/ +Los_Angeles " " Content @@ -1027,7 +1037,9 @@ getJSTestingFunctions setTimeZone ( " -PST8PDT +America +/ +Los_Angeles " ) ; @@ -1050,7 +1062,9 @@ resolvedOptions . timeZone " -PST8PDT +America +/ +Los_Angeles " " Default @@ -1102,7 +1116,9 @@ resolvedOptions . timeZone " -PST8PDT +America +/ +Los_Angeles " " Timezone @@ -1163,7 +1179,9 @@ resolvedOptions . timeZone " -PST8PDT +America +/ +Los_Angeles " " Timezone diff --git a/js/src/builtin/intl/TimeZoneDataGenerated.h b/js/src/builtin/intl/TimeZoneDataGenerated.h index 3f2b9265e9f75..76c933f48c133 100644 --- a/js/src/builtin/intl/TimeZoneDataGenerated.h +++ b/js/src/builtin/intl/TimeZoneDataGenerated.h @@ -25,11 +25,6 @@ Africa Asmara " " -Africa -/ -Timbuktu -" -" America / Argentina @@ -48,13 +43,6 @@ America / Argentina / -ComodRivadavia -" -" -America -/ -Argentina -/ Cordoba " " @@ -79,11 +67,6 @@ Atikokan " America / -Ensenada -" -" -America -/ Indiana / Indianapolis @@ -98,54 +81,9 @@ Louisville " America / -Montreal -" -" -America -/ -Nipigon -" -" -America -/ Nuuk " " -America -/ -Pangnirtung -" -" -America -/ -Rainy_River -" -" -America -/ -Rosario -" -" -America -/ -Thunder_Bay -" -" -America -/ -Yellowknife -" -" -Asia -/ -Chongqing -" -" -Asia -/ -Harbin -" -" Asia / Ho_Chi_Minh @@ -153,11 +91,6 @@ Ho_Chi_Minh " Asia / -Kashgar -" -" -Asia -/ Kathmandu " " @@ -168,11 +101,6 @@ Kolkata " Asia / -Tel_Aviv -" -" -Asia -/ Yangon " " @@ -181,74 +109,11 @@ Atlantic Faroe " " -Atlantic -/ -Jan_Mayen -" -" -Australia -/ -Currie -" -" -CET -" -" -CST6CDT -" -" -EET -" -" -EST -" -" -EST5EDT -" -" -Europe -/ -Belfast -" -" Europe / Kyiv " " -Europe -/ -Tiraspol -" -" -Europe -/ -Uzhgorod -" -" -Europe -/ -Zaporozhye -" -" -Factory -" -" -HST -" -" -MET -" -" -MST -" -" -MST7MDT -" -" -PST8PDT -" -" Pacific / Chuuk @@ -256,11 +121,6 @@ Chuuk " Pacific / -Johnston -" -" -Pacific -/ Kanton " " @@ -269,7 +129,7 @@ Pacific Pohnpei " " -WET +UTC " } ; @@ -313,6 +173,22 @@ Asmara " America / +Argentina +/ +ComodRivadavia +" +" +America +/ +Argentina +/ +Catamarca +" +} +{ +" +America +/ Buenos_Aires " " @@ -341,6 +217,18 @@ Catamarca " America / +Coral_Harbour +" +" +America +/ +Atikokan +" +} +{ +" +America +/ Cordoba " " @@ -409,196 +297,208 @@ Jujuy " America / -Kralendijk +Louisville " " America / -Curacao +Kentucky +/ +Louisville " } { " America / -Louisville +Mendoza " " America / -Kentucky +Argentina / -Louisville +Mendoza " } { " America / -Lower_Princes +Rosario " " America / -Curacao +Argentina +/ +Cordoba " } { " -America +Antarctica / -Marigot +South_Pole " " -America +Antarctica / -Port_of_Spain +McMurdo " } { " -America +Asia / -Mendoza +Calcutta " " -America -/ -Argentina +Asia / -Mendoza +Kolkata " } { " -America +Asia / -St_Barthelemy +Katmandu " " -America +Asia / -Port_of_Spain +Kathmandu " } { " -Antarctica +Asia / -South_Pole +Rangoon " " -Antarctica +Asia / -McMurdo +Yangon " } { " -Arctic +Asia / -Longyearbyen +Saigon " " -Europe +Asia / -Oslo +Ho_Chi_Minh " } { " -Asia +Atlantic / -Calcutta +Faeroe " " -Asia +Atlantic / -Kolkata +Faroe " } { " -Asia +Etc / -Chungking +GMT " " -Asia -/ -Chongqing +UTC " } { " -Asia +Etc / -Katmandu +GMT ++ +0 " " -Asia -/ -Kathmandu +UTC " } { " -Asia +Etc / -Rangoon +GMT +- +0 " " -Asia -/ -Yangon +UTC " } { " -Asia +Etc / -Saigon +GMT0 " " -Asia -/ -Ho_Chi_Minh +UTC " } { " -Atlantic +Etc / -Faeroe +Greenwich " " -Atlantic -/ -Faroe +UTC " } { " -Europe +Etc / -Bratislava +UCT " " -Europe +UTC +" +} +{ +" +Etc / -Prague +UTC +" +" +UTC " } { " -Europe +Etc / -Busingen +Universal " " -Europe +UTC +" +} +{ +" +Etc / -Zurich +Zulu +" +" +UTC " } { @@ -617,48 +517,80 @@ Kyiv " Europe / -Mariehamn +Uzhgorod " " Europe / -Helsinki +Kyiv " } { " Europe / -Podgorica +Zaporozhye " " Europe / -Belgrade +Kyiv " } { " -Europe -/ -San_Marino +GMT " " -Europe -/ -Rome +UTC " } { " -Europe +GMT ++ +0 +" +" +UTC +" +} +{ +" +GMT +- +0 +" +" +UTC +" +} +{ +" +GMT0 +" +" +UTC +" +} +{ +" +Greenwich +" +" +UTC +" +} +{ +" +Pacific / -Vatican +Enderbury " " -Europe +Pacific / -Rome +Kanton " } { @@ -699,6 +631,14 @@ Chuuk } { " +UCT +" +" +UTC +" +} +{ +" US / East @@ -713,6 +653,22 @@ Indiana Indianapolis " } +{ +" +Universal +" +" +UTC +" +} +{ +" +Zulu +" +" +UTC +" +} } ; const @@ -814,6 +770,9 @@ New VST " " +Factory +" +" SystemV / AST4 diff --git a/js/src/builtin/intl/TimeZoneMapping.yaml b/js/src/builtin/intl/TimeZoneMapping.yaml new file mode 100644 index 0000000000000..73c11492ca376 --- /dev/null +++ b/js/src/builtin/intl/TimeZoneMapping.yaml @@ -0,0 +1,700 @@ +# +This +Source +Code +Form +is +subject +to +the +terms +of +the +Mozilla +Public +# +License +v +. +2 +. +0 +. +If +a +copy +of +the +MPL +was +not +distributed +with +this +# +file +You +can +obtain +one +at +http +: +/ +/ +mozilla +. +org +/ +MPL +/ +2 +. +0 +/ +. +# +Provide +mapping +from +time +zone +identifiers +to +region +codes +for +time +zones +# +which +aren +' +t +listed +in +tzdata +' +s +zone +. +tab +file +. +Africa +/ +Timbuktu +: +ML +Africa +/ +Asmera +: +ER +America +/ +Argentina +/ +ComodRivadavia +: +AR +America +/ +Atka +: +US +America +/ +Buenos_Aires +: +AR +America +/ +Catamarca +: +AR +America +/ +Coral_Harbour +: +CA +America +/ +Cordoba +: +AR +America +/ +Ensenada +: +MX +America +/ +Fort_Wayne +: +US +America +/ +Godthab +: +GL +America +/ +Indianapolis +: +US +America +/ +Jujuy +: +AR +America +/ +Knox_IN +: +US +America +/ +Louisville +: +US +America +/ +Mendoza +: +AR +America +/ +Montreal +: +CA +America +/ +Nipigon +: +CA +America +/ +Pangnirtung +: +CA +America +/ +Porto_Acre +: +BR +America +/ +Rainy_River +: +CA +America +/ +Rosario +: +AR +America +/ +Santa_Isabel +: +MX +America +/ +Shiprock +: +US +America +/ +Thunder_Bay +: +CA +America +/ +Virgin +: +VI +America +/ +Yellowknife +: +CA +Antarctica +/ +South_Pole +: +AQ +Asia +/ +Choibalsan +: +MN +Asia +/ +Chongqing +: +CN +Asia +/ +Harbin +: +CN +Asia +/ +Kashgar +: +CN +Asia +/ +Tel_Aviv +: +IL +Asia +/ +Ashkhabad +: +TM +Asia +/ +Calcutta +: +IN +Asia +/ +Chungking +: +CN +Asia +/ +Dacca +: +BD +Asia +/ +Istanbul +: +TR +Asia +/ +Katmandu +: +NP +Asia +/ +Macao +: +MO +Asia +/ +Rangoon +: +MM +Asia +/ +Saigon +: +VN +Asia +/ +Thimbu +: +BT +Asia +/ +Ujung_Pandang +: +ID +Asia +/ +Ulan_Bator +: +MN +Atlantic +/ +Jan_Mayen +: +SJ +Atlantic +/ +Faeroe +: +FO +Australia +/ +ACT +: +AU +Australia +/ +LHI +: +AU +Australia +/ +NSW +: +AU +Australia +/ +Canberra +: +AU +Australia +/ +Currie +: +AU +Australia +/ +North +: +AU +Australia +/ +Queensland +: +AU +Australia +/ +South +: +AU +Australia +/ +Tasmania +: +AU +Australia +/ +Victoria +: +AU +Australia +/ +West +: +AU +Australia +/ +Yancowinna +: +AU +Europe +/ +Belfast +: +GB +Europe +/ +Tiraspol +: +MD +Europe +/ +Uzhgorod +: +UA +Europe +/ +Zaporozhye +: +UA +Europe +/ +Kiev +: +UA +Europe +/ +Nicosia +: +CY +Pacific +/ +Samoa +: +AS +Pacific +/ +Enderbury +: +KI +Pacific +/ +Johnston +: +US +Pacific +/ +Yap +: +FM +Pacific +/ +Ponape +: +FM +Pacific +/ +Truk +: +FM +Brazil +/ +Acre +: +BR +Brazil +/ +DeNoronha +: +BR +Brazil +/ +East +: +BR +Brazil +/ +West +: +BR +Canada +/ +Atlantic +: +CA +Canada +/ +Central +: +CA +Canada +/ +Eastern +: +CA +Canada +/ +Mountain +: +CA +Canada +/ +Newfoundland +: +CA +Canada +/ +Pacific +: +CA +Canada +/ +Saskatchewan +: +CA +Canada +/ +Yukon +: +CA +Chile +/ +Continental +: +CL +Chile +/ +EasterIsland +: +CL +Mexico +/ +BajaNorte +: +MX +Mexico +/ +BajaSur +: +MX +Mexico +/ +General +: +MX +US +/ +Alaska +: +US +US +/ +Aleutian +: +US +US +/ +Arizona +: +US +US +/ +Central +: +US +US +/ +East +- +Indiana +: +US +US +/ +Eastern +: +US +US +/ +Hawaii +: +US +US +/ +Indiana +- +Starke +: +US +US +/ +Michigan +: +US +US +/ +Mountain +: +US +US +/ +Pacific +: +US +US +/ +Samoa +: +AS +CET +: +BE +EET +: +GR +MET +: +BE +WET +: +PT +CST6CDT +: +US +EST5EDT +: +US +EST +: +PA +HST +: +US +MST7MDT +: +US +MST +: +US +PST8PDT +: +US +Cuba +: +CU +Egypt +: +EG +Eire +: +IE +GB +: +GB +GB +- +Eire +: +GB +Hongkong +: +HK +Iceland +: +IS +Iran +: +IR +Israel +: +IL +Jamaica +: +JM +Japan +: +JP +Kwajalein +: +MH +Libya +: +LY +NZ +: +NZ +NZ +- +CHAT +: +NZ +Navajo +: +US +PRC +: +CN +Poland +: +PL +Portugal +: +PT +ROC +: +TW +ROK +: +KR +Singapore +: +SG +Turkey +: +TR +W +- +SU +: +RU diff --git a/js/src/builtin/intl/make_intl_data.py b/js/src/builtin/intl/make_intl_data.py index 12ee651e11205..1c4de2d4ead18 100644 --- a/js/src/builtin/intl/make_intl_data.py +++ b/js/src/builtin/intl/make_intl_data.py @@ -273,8 +273,6 @@ import re import -sys -import tarfile import tempfile @@ -291,90 +289,21 @@ itertools import chain +filterfalse groupby tee +zip_longest from operator import attrgetter itemgetter -from -zipfile -import -ZipFile -import -yaml -if -sys -. -version_info -. -major -= -= -2 -: - -from -itertools -import -ifilter -as -filter - -from -itertools -import -ifilterfalse -as -filterfalse - -from -itertools -import -imap -as -map - -from -itertools -import -izip_longest -as -zip_longest - -from -urllib2 -import -Request -as -UrlRequest - -from -urllib2 -import -urlopen - -from -urlparse -import -urlsplit -else -: - -from -itertools -import -filterfalse -zip_longest - from urllib . parse import urlsplit - from urllib . @@ -383,13 +312,18 @@ Request as UrlRequest - from urllib . request import urlopen +from +zipfile +import +ZipFile +import +yaml def grouper ( @@ -12587,6 +12521,20 @@ r " +( +# +PACKRATLIST +\ +s ++ +zone +. +tab +\ +s ++ +) +? Link \ s @@ -12624,6 +12572,7 @@ ) ? " + % ( nameSyntax @@ -12723,6 +12672,12 @@ ( ) +packrat_links += +dict +( +) + for filename in @@ -12799,17 +12754,51 @@ ] = target + +if +line +. +startswith +( +" +# +PACKRATLIST +zone +. +tab +Link +" +) +: + +( +link +target +) += +createLink +( +line +filename +) + +packrat_links +[ +link +] += +target return ( zones links +packrat_links ) def readIANATimeZones ( tzdataDir -ignoreBackzone ignoreFactory ) : @@ -12830,107 +12819,55 @@ " " -backzoneFiles +files_to_ignore = -{ +[ " backzone " -} - -( -bkfiles -tzfiles -) -= -partition -( -listIANAFiles -( -tzdataDir -) -backzoneFiles -. -__contains__ -) - -( -zones -links -) -= -readIANAFiles -( -tzdataDir -tzfiles -) - -( -backzones -backlinks -) -= -readIANAFiles -( -tzdataDir -bkfiles -) +] if ignoreFactory : -zones +files_to_ignore . -remove -( -Zone +append ( " -Factory +factory " ) -) -if -not -ignoreBackzone -: - -zones -| -= -backzones - -links +tzfiles = -{ - -name -: -target +( +file for -name -target +file in -links -. -items +listIANAFiles ( +tzdataDir ) if -name +file not in -backzones - -} - +files_to_ignore +) + +( +zones links -. -update +_ +) += +readIANAFiles ( -backlinks +tzdataDir +tzfiles ) validateTimeZones @@ -14143,41 +14080,94 @@ ignoreFactory : -zoneinfoZones -. -remove -( +assert Zone ( " Factory " ) +in +zoneinfoZones + +assert +Zone +( +" +Factory +" ) - -for -zones +not in +zoneinfoLinks + +assert +Zone ( -zoneinfoZones +" +Factory +" +) +not +in typesZones + +assert +Zone +( +" +Factory +" ) -: +in +typesLinks -zones +zoneinfoZones . remove ( Zone ( " -Etc -/ -Unknown +Factory " ) ) - + +del +typesLinks +[ +Zone +( +" +Factory +" +) +] + +for +zones +in +( +zoneinfoZones +typesZones +) +: + +zones +. +remove +( +Zone +( +" +Etc +/ +Unknown +" +) +) + for links in @@ -14494,6 +14484,7 @@ ( zones links +_ ) = readIANAFiles @@ -14958,7 +14949,6 @@ ianaLinks icuZones icuLinks -ignoreBackzone ) : @@ -15035,29 +15025,8 @@ ) ] -expectedMissing -= -[ -] -if -ignoreBackzone -else -[ -Zone -( -" -Asia -/ -Hanoi -" -) -] - if missingTimeZones -! -= -expectedMissing : raise @@ -15561,80 +15530,198 @@ 0 ) ) -generatedFileWarning +def +readZoneTab +( +tzdataDir +) +: + +zone_country += +dict +( +) + +zonetab_path = +tzdataDir +. +resolve +( " -/ -/ -Generated -by -make_intl_data +zone . -py +tab +" +) + +for +line +in +tzdataDir . -DO -NOT -EDIT +readlines +( +zonetab_path +) +: + +if +line . +startswith +( " -tzdataVersionComment -= +# " -/ -/ -tzdata -version +) +: + +continue + +( +country +coords +zone +* +comments +) = -{ -0 -} +line +. +strip +( +) +. +split +( +" +\ +t " +) + +assert +zone +not +in +zone_country + +zone_country +[ +zone +] += +country + +return +zone_country def -processTimeZones +availableNamedTimeZoneIdentifiers ( - tzdataDir -icuDir -icuTzDir -version -ignoreBackzone ignoreFactory -out ) : +js_src_builtin_intl_dir += +os +. +path +. +dirname +( +os +. +path +. +abspath +( +__file__ +) +) + +with +io +. +open +( + +os +. +path +. +join +( +js_src_builtin_intl_dir " +TimeZoneMapping +. +yaml " +) + +mode += " -Read -the -time -zone -info -and -create -a -new -time -zone -cpp -file -. +r " + +encoding += " +utf +- +8 " -print -( -" -Processing -tzdata -mapping -. -. +) +as +f +: + +time_zone_mapping += +yaml . -" +safe_load +( +f +) + +zone_country += +readZoneTab +( +tzdataDir +) + +def +country_code_for +( +name ) +: + +if +name +in +zone_country +: + +return +zone_country +[ +name +] + +return +time_zone_mapping +[ +name +] ( ianaZones @@ -15644,640 +15731,643 @@ readIANATimeZones ( tzdataDir -ignoreBackzone ignoreFactory ) ( -icuZones -icuLinks +backzones +backlinks +packratlinks ) = -readICUTimeZones +readIANAFiles ( -icuDir -icuTzDir -ignoreFactory +tzdataDir +[ +" +backzone +" +] ) +all_backzone_links += +{ +* +* +backlinks +* +* +packratlinks +} + +zones += +set ( -legacyZones -legacyLinks ) + +links = -readICULegacyZones +dict ( -icuDir ) -icuZones -= -{ -zone for zone in -icuZones -if +ianaZones +: + +primary += zone -not + +if +primary +. +name in -legacyZones -} - -icuLinks +[ +" +Etc +/ +UTC +" +" +Etc +/ +GMT +" +" +GMT +" +] +: + +primary = -{ +Zone +( +" +UTC +" +primary +. +filename +) +if +primary += += zone : -target -for -( + +assert zone -target -) +not in -icuLinks +zones + +zones . -items +add ( +primary ) -if + +else +: + +assert zone not in -legacyLinks - -} - -incorrectZones +links + +links +[ +zone +] = -findIncorrectICUZones -( - -ianaZones -ianaLinks -icuZones -icuLinks -ignoreBackzone +primary +. +name +for +zone +target +in +ianaLinks +. +items +( ) - -if -not -incorrectZones : -print -( -" -< -< -< -No -incorrect -ICU -time -zones -found -please -update -Intl +identifier += +zone . -js -! -> -> -> -" -) +name -print -( -" -< -< -< -Maybe -https +primary += +identifier + +if +identifier +not +in +zone_country : -/ -/ -ssl -. -icu -- -project + +if +target . -org -/ -trac -/ -ticket +startswith +( +" +Etc / -12044 -was -fixed -? -> -> -> " ) - -incorrectLinks +: + +primary = -findIncorrectICULinks +target + +else +: + +identifier_code_code += +country_code_for ( -ianaZones -ianaLinks -icuZones -icuLinks +identifier ) - + +target_code_code += +country_code_for +( +target +) + if -not -incorrectLinks +identifier_code_code += += +target_code_code : - -print + +primary += +target + +else +: + +country_code_line_count += +[ + +zone + +for ( -" -< -< -< -No -incorrect -ICU -time zone -links -found -please -update -Intl -. -js -! -> -> -> -" +code ) - -print -( -" -< -< -< -Maybe -https -: -/ -/ -ssl -. -icu -- -project +in +zone_country . -org -/ -trac -/ -ticket -/ -12044 -was -fixed -? -> -> -> -" -) - -print +items ( -" -Writing -Intl -tzdata -file -. -. -. -" ) - -with -io -. -open -( -out -mode -= -" -w -" -encoding + +if +code = -" -utf -- -8 -" -newline = -" -" +identifier_code_code + +] + +if +len +( +country_code_line_count ) -as -f += += +1 : - -println + +primary = -partial +country_code_line_count +[ +0 +] + +else +: + +assert +Zone ( -print -file -= -f +identifier ) - -println +in +all_backzone_links + +primary += +all_backzone_links +[ +Zone ( -generatedFileWarning +identifier ) - -println -( -tzdataVersionComment -. -format +] + +assert +identifier_code_code += += +country_code_for ( -version -) +primary ) -println -( +if +primary +in +[ " +Etc +/ +UTC " -) - -println -( " -# -ifndef -builtin_intl_TimeZoneDataGenerated_h +Etc +/ +GMT " -) - -println -( " -# -define -builtin_intl_TimeZoneDataGenerated_h +GMT " -) - -println -( +] +: + +primary += " +UTC " -) -println +if +primary += += +identifier +: + +assert +zone +not +in +zones + +zones +. +add ( -" -namespace -js -{ -" +zone ) -println +else +: + +assert +zone +not +in +links + +links +[ +zone +] += +primary + +validateTimeZones ( -" -namespace -timezone -{ -" +zones +links ) - -println + +assert +Zone ( " +UTC " ) - -println +in +zones + +return ( -" -/ -/ -Format -: -" +zones +links ) - -println -( -' +generatedFileWarning += +" / / +Generated +by +make_intl_data +. +py +. +DO +NOT +EDIT +. " -ZoneName +tzdataVersionComment += " / / -ICU -- -Name -[ -time -zone -file -] -' -) - -println -( -" -const -char -* -const -ianaZonesTreatedAsLinksByICU -[ -] +tzdata +version = { +0 +} " +def +processTimeZones +( +tzdataDir +icuDir +icuTzDir +version +ignoreFactory +out ) - -for -zone -icuZone -in -incorrectZones : - -println -( -' + " -% -s " -/ -/ -% -s -[ -% -s -] -' -% -( +" +Read +the +time zone -icuZone +info +and +create +a +new +time zone +cpp +file . -filename -) -) - -println -( -" -} -; " -) - -println -( " " -) - -println + +print ( " -/ -/ -Format -: +Processing +tzdata +mapping +. +. +. " ) - -println + ( -' -/ -/ -" -LinkName -" -" -Target -" -/ -/ -ICU -- -Target -[ -time -zone -file -] -' +ianaZones +ianaLinks ) - -println += +availableNamedTimeZoneIdentifiers ( -" -struct -LinkAndTarget -" +tzdataDir +ignoreFactory ) - -println + ( -" -{ -" +icuZones +icuLinks ) - -println += +readICUTimeZones ( -" -const -char -* -const -link -; -" +icuDir +icuTzDir +ignoreFactory ) - -println + ( -" -const -char -* -const -target -; -" +legacyZones +legacyLinks ) - -println += +readICULegacyZones ( -" -} -; -" +icuDir ) + +if +ignoreFactory +: -println +legacyZones +. +add +( +Zone ( " +Factory " ) - -println -( -" -const -LinkAndTarget -ianaLinksCanonicalizedDifferentlyByICU -[ -] +) + +icuZones = { -" -) - +zone for zone -target -icuTarget in -incorrectLinks -: - -println -( - -' -{ -" -% -s -" -" -% -s -" +icuZones +if +zone +not +in +legacyZones } -/ -/ -% -s -[ -% -s -] -' - -% -( + +icuLinks += +{ + zone +: target -icuTarget +for +( zone -. -filename -) - +target ) - -println +in +icuLinks +. +items ( -" -} -; -" ) - -println -( -" -" +if +zone +not +in +legacyLinks + +} + +incorrectZones += +findIncorrectICUZones +( +ianaZones +ianaLinks +icuZones +icuLinks ) + +if +not +incorrectZones +: -println +print ( - " -/ -/ -Legacy +< +< +< +No +incorrect ICU time zones -these -are -not -valid -IANA -time -zone -names +found +please +update +Intl . -We -also +js +! +> +> +> " - ) -println +print ( " +< +< +< +Maybe +https +: / / -disallow -the -old -and -deprecated -System -V +ssl +. +icu +- +project +. +org +/ +trac +/ +ticket +/ +12044 +was +fixed +? +> +> +> +" +) + +incorrectLinks += +findIncorrectICULinks +( +ianaZones +ianaLinks +icuZones +icuLinks +) + +if +not +incorrectLinks +: + +print +( +" +< +< +< +No +incorrect +ICU time -zones +zone +links +found +please +update +Intl . +js +! +> +> +> " ) -println +print ( - " -/ -/ +< +< +< +Maybe https : / @@ -16290,297 +16380,240 @@ . org / -repos -/ -icu -/ -trunk -/ -icu4c -/ -source -/ -tools +trac / -tzcode +ticket / -icuzones +12044 +was +fixed +? +> +> +> " - ) - -println + +print ( " -const -char -* -const -legacyICUTimeZones -[ -] +Writing +Intl +tzdata +file +. +. +. +" +) + +with +io +. +open +( +out +mode += +" +w +" +encoding += +" +utf +- +8 +" +newline = -{ +" " ) +as +f +: -for -zone -in -chain -( -sorted -( -legacyLinks -. -keys +println += +partial ( +print +file += +f ) + +println +( +generatedFileWarning ) -sorted + +println ( -legacyZones +tzdataVersionComment +. +format +( +version ) ) -: - + println ( -' " -% -s " -' -% -zone ) println ( " -} -; +# +ifndef +builtin_intl_TimeZoneDataGenerated_h " ) println ( " +# +define +builtin_intl_TimeZoneDataGenerated_h " ) println ( " -} -/ -/ -namespace -timezone " ) println ( " -} -/ -/ namespace js +{ " ) println ( " +namespace +timezone +{ " ) println ( " -# -endif -/ -* -builtin_intl_TimeZoneDataGenerated_h -* -/ " ) -def -updateBackzoneLinks + +println ( -tzdataDir -links -) +" +/ +/ +Format : - -def -withZone -( -fn +" ) -: -return -lambda -zone_target -: -fn +println ( -zone_target +' +/ +/ +" +ZoneName +" +/ +/ +ICU +- +Name [ -0 +time +zone +file ] +' ) - -( -backzoneZones -backzoneLinks -) -= -readIANAFiles + +println ( -tzdataDir -[ -" -backzone " +const +char +* +const +ianaZonesTreatedAsLinksByICU +[ ] -) - -( -stableZones -updatedLinks -updatedZones -) = -partition -( - -links -. -items -( +{ +" ) -withZone -( -lambda -zone -: -zone -not -in -backzoneLinks -and +for zone -not +icuZone in -backzoneZones -) - -withZone -( -lambda -zone +incorrectZones : -zone -in -backzoneLinks -) - -) - -return -dict -( - -chain -( -stableZones - -map -( -withZone +println ( -lambda -zone -: +' +" +% +s +" +/ +/ +% +s +[ +% +s +] +' +% ( zone -backzoneLinks -[ +icuZone zone -] -) +. +filename ) -updatedLinks ) -) - -) -def -generateTzDataLinkTestContent +println ( -testDir -version -fileName -description -links +" +} +; +" ) -: - -with -io -. -open -( -os -. -path -. -join +println ( -testDir -fileName -) -mode -= -" -w -" -encoding -= -" -utf -- -8 -" -newline -= " " - ) -as -f -: println -= -partial ( -print -file -= -f +" +/ +/ +Format +: +" ) println @@ -16588,98 +16621,86 @@ ' / / -| -reftest -| -skip -- -if -( -! -this -. -hasOwnProperty -( " -Intl +LinkName " -) -) +" +Target +" +/ +/ +ICU +- +Target +[ +time +zone +file +] ' ) println ( " +struct +LinkAndTarget " ) println ( -generatedFileWarning +" +{ +" ) println ( -tzdataVersionComment -. -format -( -version -) +" +const +char +* +const +link +; +" ) println ( - " +const +char +* +const +target +; " +) + +println +( " -const -tzMapper -= -[ - -x -= -> -x - -x -= -> -x -. -toUpperCase -( -) - -x -= -> -x -. -toLowerCase -( -) -] +} ; " -" -" - ) println ( -description +" +" ) println ( " const -links +LinkAndTarget +ianaLinksCanonicalizedDifferentlyByICU +[ +] = { " @@ -16688,37 +16709,45 @@ for zone target +icuTarget in -sorted -( -links -key -= -itemgetter -( -0 -) -) +incorrectLinks : println ( + ' +{ " % s " -: " % s " +} +/ +/ +% +s +[ +% +s +] ' + % ( zone target +icuTarget +zone +. +filename ) + ) println @@ -16731,306 +16760,356 @@ println ( - -" " " -for +) + +println ( -let -[ -linkName -target -] -of -Object + +" +/ +/ +Legacy +ICU +time +zones +these +are +not +valid +IANA +time +zone +names . -entries -( -links -) +We +also +" + ) -{ - -if + +println ( -target -= -= -= " -Etc / -UTC +/ +disallow +the +old +and +deprecated +System +V +time +zones +. " -| -| -target -= -= -= +) + +println +( + " -Etc / -GMT +/ +https +: +/ +/ +ssl +. +icu +- +project +. +org +/ +repos +/ +icu +/ +trunk +/ +icu4c +/ +source +/ +tools +/ +tzcode +/ +icuzones " + ) -target -= +println +( " -UTC +const +char +* +const +legacyICUTimeZones +[ +] += +{ " -; - -for -( -let -map -of -tzMapper ) -{ -let -dtf -= -new -Intl +for +zone +in +chain +( +sorted +( +legacyLinks . -DateTimeFormat +keys ( -undefined -{ -timeZone +) +) +sorted +( +legacyZones +) +) : -map + +println ( -linkName +' +" +% +s +" +' +% +zone ) + +println +( +" } -) ; +" +) -let -resolvedTimeZone -= -dtf -. -resolvedOptions +println ( +" +" ) -. -timeZone -; -assertEq +println ( -resolvedTimeZone -target -{ -linkName +" } -- -> -{ -target -} -) -; - -} -} -" -" +/ +/ +namespace +timezone " - ) println ( - -" -" -" -if -( -typeof -reportCompare -= -= -= " -function +} +/ +/ +namespace +js " ) - -reportCompare + +println ( -0 -0 " -ok " ) -; -" + +println +( " +# +endif +/ +* +builtin_intl_TimeZoneDataGenerated_h +* +/ " - ) def -generateTzDataTestBackwardLinks +generateTzDataTestLinks ( tzdataDir version -ignoreBackzone +ignoreFactory testDir ) : +fileName += +" +timeZone_links +. +js +" + ( -zones +_ links ) = -readIANAFiles +availableNamedTimeZoneIdentifiers ( tzdataDir -[ -" -backward -" -] +ignoreFactory ) -assert -len +with +io +. +open ( -zones + +os +. +path +. +join +( +testDir +fileName ) +mode = +" +w +" +encoding = -0 +" +utf +- +8 +" +newline += +" +" -if -not -ignoreBackzone +) +as +f : -links +println = -updateBackzoneLinks +partial ( -tzdataDir -links +print +file += +f ) - -generateTzDataLinkTestContent -( - -testDir - -version -" -timeZone_backward_links -. -js -" - -" +println +( +' / / -Link -names -derived -from -IANA -Time -Zone -Database -backward -file +| +reftest +| +skip +- +if +( +! +this . +hasOwnProperty +( +" +Intl " +) +) +' +) -links -. -items +println ( +" +" ) - + +println +( +generatedFileWarning ) -def -generateTzDataTestNotBackwardLinks + +println +( +tzdataVersionComment +. +format ( -tzdataDir version -ignoreBackzone -testDir ) -: - -tzfiles -= -filterfalse -( +) -{ -" -backward +println +( + " " -backzone " -} -. -__contains__ -listIANAFiles -( -tzdataDir -) +const +tzMapper += +[ -) +x += +> +x -( -zones -links -) +x = -readIANAFiles +> +x +. +toUpperCase ( -tzdataDir -tzfiles ) -if -not -ignoreBackzone -: - -links +x = -updateBackzoneLinks +> +x +. +toLowerCase ( -tzdataDir -links ) - -generateTzDataLinkTestContent -( - -testDir - -version - +] +; " -timeZone_notbackward_links -. -js " +" + +) +println +( " / / @@ -17042,475 +17121,217 @@ Time Zone Database -excluding -backward -file . " +) -links -. -items +println ( +" +const +links += +{ +" ) - -) -def -generateTzDataTestBackzone -( -tzdataDir -version -ignoreBackzone -testDir -) -: - -backzoneFiles -= -{ -" -backzone -" -} - -( -bkfiles -tzfiles -) -= -partition -( -listIANAFiles + +for +zone +target +in +sorted ( -tzdataDir -) -backzoneFiles +links . -__contains__ -) - +items ( -zones -links ) +key = -readIANAFiles -( -tzdataDir -tzfiles -) - +itemgetter ( -backzones -backlinks +0 ) -= -readIANAFiles -( -tzdataDir -bkfiles ) - -if -not -ignoreBackzone : - -comment -= + +println +( +' " +% +s " +: " -\ -/ -/ -This -file -was -generated -with -historical -pre -- -1970 -backzone -information -/ -/ -respected -. -Therefore -every +% +s +" +' +% +( zone -key -listed -below -is -its -own -Zone -not -/ -/ -a -Link -to -a -modern -- -day target -as -IANA -ignoring -backzones -would -say -. -" +) +) + +println +( " +} +; " - -else -: +) -comment -= +println +( + " " " -\ -/ -/ -This -file -was -generated -while -ignoring -historical -pre -- -1970 -backzone -/ -/ -information -. -Therefore -every -zone -key -listed -below -is -part -of -a -Link -/ -/ -whose +for +( +let +[ +linkName target -is -the -corresponding -value +] +of +Object . -" -" -" +entries +( +links +) +) +{ -generateTzDataLinkTestContent +if ( - -testDir - -version - +target += += += " -timeZone_backzone -. -js +Etc +/ +UTC " - -comment -+ +| +| +target += += += " +Etc / -/ -Backzone -zones -derived -from -IANA -Time -Zone -Database -. +GMT " - -( - -( -zone -zone -if -not -ignoreBackzone -else -links -[ -zone -] ) - -for -zone -in -backzones - -if -zone -in -links -) - -) -def -generateTzDataTestBackzoneLinks -( -tzdataDir -version -ignoreBackzone -testDir -) -: - -backzoneFiles +target = -{ " -backzone +UTC " -} +; +for ( -bkfiles -tzfiles +let +map +of +tzMapper ) +{ + +let +dtf = -partition -( -listIANAFiles -( -tzdataDir -) -backzoneFiles +new +Intl . -__contains__ -) - -( -zones -links -) -= -readIANAFiles +DateTimeFormat ( -tzdataDir -tzfiles -) - +undefined +{ +timeZone +: +map ( -backzones -backlinks +linkName ) -= -readIANAFiles -( -tzdataDir -bkfiles +} ) - -if -not -ignoreBackzone -: +; -comment +let +resolvedTimeZone = -" -" -" -\ -/ -/ -This -file -was -generated -with -historical -pre -- -1970 -backzone -information -/ -/ -respected +dtf . -Therefore -every -zone -key -listed -below -points -to -a -target -/ -/ -in -the -backzone -file -and -not -to -its -modern -- -day -target -as -IANA -ignoring -/ -/ -backzones -would -say +resolvedOptions +( +) . -" -" -" - -else -: +timeZone +; -comment -= -" -" -" -\ -/ -/ -This -file -was -generated -while -ignoring -historical -pre +assertEq +( +resolvedTimeZone +target +{ +linkName +} - -1970 -backzone -/ -/ -information -. -Therefore -every -zone -key -listed -below -is -part -of -a -Link -/ -/ -whose +> +{ target -is -the -corresponding -value -ignoring -any -backzone -entries -. -" -" -" +} +) +; -generateTzDataLinkTestContent -( - -testDir - -version - -" -timeZone_backzone_links -. -js +} +} " - -comment -+ " -/ -/ -Backzone -links -derived -from -IANA -Time -Zone -Database -. " -( - -( -zone -target -if -not -ignoreBackzone -else -links -[ -zone -] ) + +println +( -for +" +" +" +if ( -zone -target +typeof +reportCompare += += += +" +function +" ) -in -backlinks -. -items + +reportCompare ( +0 +0 +" +ok +" ) +; +" +" +" -) - ) def generateTzDataTestVersion @@ -17723,10 +17544,8 @@ def generateTzDataTestCanonicalZones ( - tzdataDir version -ignoreBackzone ignoreFactory testDir ) @@ -17745,133 +17564,16 @@ " ( -ianaZones +zones _ ) = -readIANATimeZones +availableNamedTimeZoneIdentifiers ( tzdataDir -ignoreBackzone ignoreFactory ) -ianaZones -. -remove -( -Zone -( -" -Etc -/ -GMT -" -) -) - -ianaZones -. -remove -( -Zone -( -" -Etc -/ -UTC -" -) -) - -ianaZones -. -add -( -Zone -( -" -UTC -" -) -) - -ianaZones -. -remove -( -Zone -( -" -Asia -/ -Hanoi -" -) -) - -if -not -ignoreBackzone -: - -comment -= -" -" -" -\ -/ -/ -This -file -was -generated -with -historical -pre -- -1970 -backzone -information -/ -/ -respected -. -" -" -" - -else -: - -comment -= -" -" -" -\ -/ -/ -This -file -was -generated -while -ignoring -historical -pre -- -1970 -backzone -/ -/ -information -. -" -" -" - with io . @@ -17965,17 +17667,6 @@ ) ) -println -( -" -" -) - -println -( -comment -) - println ( " @@ -17991,7 +17682,7 @@ in sorted ( -ianaZones +zones ) : @@ -18070,7 +17761,6 @@ ( tzdataDir version -ignoreBackzone ignoreFactory testDir ) @@ -18117,35 +17807,11 @@ dtfTestDir ) -generateTzDataTestBackwardLinks -( -tzdataDir -version -ignoreBackzone -dtfTestDir -) - -generateTzDataTestNotBackwardLinks -( -tzdataDir -version -ignoreBackzone -dtfTestDir -) - -generateTzDataTestBackzone +generateTzDataTestLinks ( tzdataDir version -ignoreBackzone -dtfTestDir -) - -generateTzDataTestBackzoneLinks -( -tzdataDir -version -ignoreBackzone +ignoreFactory dtfTestDir ) @@ -18158,13 +17824,10 @@ generateTzDataTestCanonicalZones ( - tzdataDir version -ignoreBackzone ignoreFactory testDir - ) def updateTzdata @@ -18378,21 +18041,15 @@ tzDir ) -ignoreBackzone +out = args . -ignore_backzone +out ignoreFactory = -False - -out -= -args -. -out +True version = @@ -18518,21 +18175,6 @@ icuTzDir ) -print -( -" -\ -tIgnore -backzone -file -: -% -s -" -% -ignoreBackzone -) - print ( " @@ -18608,8 +18250,6 @@ version -ignoreBackzone - ignoreFactory out @@ -18624,7 +18264,6 @@ tar ) version -ignoreBackzone ignoreFactory intlTestDir @@ -18655,8 +18294,6 @@ version -ignoreBackzone - ignoreFactory out @@ -18665,16 +18302,13 @@ generateTzDataTests ( - TzDataDir ( f ) version -ignoreBackzone ignoreFactory intlTestDir - ) else @@ -25623,67 +25257,6 @@ add_argument ( -" -- -- -ignore -- -backzone -" - -action -= -" -store_true -" - -help -= -" -Ignore -tzdata -' -s -' -backzone -' -file -. -Can -be -enabled -to -generate -more -" - -" -accurate -time -zone -canonicalization -reflecting -the -actual -time -" - -" -zones -as -used -by -ICU -. -" - -) - -parser_tz -. -add_argument -( - " - - diff --git a/js/src/jit-test/tests/resist-fingerprinting/timezone.js b/js/src/jit-test/tests/resist-fingerprinting/timezone.js index 00eb8b7fe7ae5..fa2a704158373 100644 --- a/js/src/jit-test/tests/resist-fingerprinting/timezone.js +++ b/js/src/jit-test/tests/resist-fingerprinting/timezone.js @@ -121,7 +121,9 @@ resolvedOptions . timeZone " -PST8PDT +America +/ +Los_Angeles " ) ; diff --git a/js/src/tests/non262/Intl/DateTimeFormat/timeZone_backzone.js b/js/src/tests/non262/Intl/DateTimeFormat/timeZone_backzone.js deleted file mode 100644 index 0dc1b99c3519f..0000000000000 --- a/js/src/tests/non262/Intl/DateTimeFormat/timeZone_backzone.js +++ /dev/null @@ -1,1538 +0,0 @@ -const -tzMapper -= -[ -x -= -> -x -x -= -> -x -. -toUpperCase -( -) -x -= -> -x -. -toLowerCase -( -) -] -; -const -links -= -{ -" -Africa -/ -Accra -" -: -" -Africa -/ -Accra -" -" -Africa -/ -Addis_Ababa -" -: -" -Africa -/ -Addis_Ababa -" -" -Africa -/ -Asmara -" -: -" -Africa -/ -Asmara -" -" -Africa -/ -Bamako -" -: -" -Africa -/ -Bamako -" -" -Africa -/ -Bangui -" -: -" -Africa -/ -Bangui -" -" -Africa -/ -Banjul -" -: -" -Africa -/ -Banjul -" -" -Africa -/ -Blantyre -" -: -" -Africa -/ -Blantyre -" -" -Africa -/ -Brazzaville -" -: -" -Africa -/ -Brazzaville -" -" -Africa -/ -Bujumbura -" -: -" -Africa -/ -Bujumbura -" -" -Africa -/ -Conakry -" -: -" -Africa -/ -Conakry -" -" -Africa -/ -Dakar -" -: -" -Africa -/ -Dakar -" -" -Africa -/ -Dar_es_Salaam -" -: -" -Africa -/ -Dar_es_Salaam -" -" -Africa -/ -Djibouti -" -: -" -Africa -/ -Djibouti -" -" -Africa -/ -Douala -" -: -" -Africa -/ -Douala -" -" -Africa -/ -Freetown -" -: -" -Africa -/ -Freetown -" -" -Africa -/ -Gaborone -" -: -" -Africa -/ -Gaborone -" -" -Africa -/ -Harare -" -: -" -Africa -/ -Harare -" -" -Africa -/ -Kampala -" -: -" -Africa -/ -Kampala -" -" -Africa -/ -Kigali -" -: -" -Africa -/ -Kigali -" -" -Africa -/ -Kinshasa -" -: -" -Africa -/ -Kinshasa -" -" -Africa -/ -Libreville -" -: -" -Africa -/ -Libreville -" -" -Africa -/ -Lome -" -: -" -Africa -/ -Lome -" -" -Africa -/ -Luanda -" -: -" -Africa -/ -Luanda -" -" -Africa -/ -Lubumbashi -" -: -" -Africa -/ -Lubumbashi -" -" -Africa -/ -Lusaka -" -: -" -Africa -/ -Lusaka -" -" -Africa -/ -Malabo -" -: -" -Africa -/ -Malabo -" -" -Africa -/ -Maseru -" -: -" -Africa -/ -Maseru -" -" -Africa -/ -Mbabane -" -: -" -Africa -/ -Mbabane -" -" -Africa -/ -Mogadishu -" -: -" -Africa -/ -Mogadishu -" -" -Africa -/ -Niamey -" -: -" -Africa -/ -Niamey -" -" -Africa -/ -Nouakchott -" -: -" -Africa -/ -Nouakchott -" -" -Africa -/ -Ouagadougou -" -: -" -Africa -/ -Ouagadougou -" -" -Africa -/ -Porto -- -Novo -" -: -" -Africa -/ -Porto -- -Novo -" -" -Africa -/ -Timbuktu -" -: -" -Africa -/ -Timbuktu -" -" -America -/ -Anguilla -" -: -" -America -/ -Anguilla -" -" -America -/ -Antigua -" -: -" -America -/ -Antigua -" -" -America -/ -Argentina -/ -ComodRivadavia -" -: -" -America -/ -Argentina -/ -ComodRivadavia -" -" -America -/ -Aruba -" -: -" -America -/ -Aruba -" -" -America -/ -Atikokan -" -: -" -America -/ -Atikokan -" -" -America -/ -Blanc -- -Sablon -" -: -" -America -/ -Blanc -- -Sablon -" -" -America -/ -Cayman -" -: -" -America -/ -Cayman -" -" -America -/ -Coral_Harbour -" -: -" -America -/ -Coral_Harbour -" -" -America -/ -Creston -" -: -" -America -/ -Creston -" -" -America -/ -Curacao -" -: -" -America -/ -Curacao -" -" -America -/ -Dominica -" -: -" -America -/ -Dominica -" -" -America -/ -Ensenada -" -: -" -America -/ -Ensenada -" -" -America -/ -Grenada -" -: -" -America -/ -Grenada -" -" -America -/ -Guadeloupe -" -: -" -America -/ -Guadeloupe -" -" -America -/ -Montreal -" -: -" -America -/ -Montreal -" -" -America -/ -Montserrat -" -: -" -America -/ -Montserrat -" -" -America -/ -Nassau -" -: -" -America -/ -Nassau -" -" -America -/ -Nipigon -" -: -" -America -/ -Nipigon -" -" -America -/ -Pangnirtung -" -: -" -America -/ -Pangnirtung -" -" -America -/ -Port_of_Spain -" -: -" -America -/ -Port_of_Spain -" -" -America -/ -Rainy_River -" -: -" -America -/ -Rainy_River -" -" -America -/ -Rosario -" -: -" -America -/ -Rosario -" -" -America -/ -St_Kitts -" -: -" -America -/ -St_Kitts -" -" -America -/ -St_Lucia -" -: -" -America -/ -St_Lucia -" -" -America -/ -St_Thomas -" -: -" -America -/ -St_Thomas -" -" -America -/ -St_Vincent -" -: -" -America -/ -St_Vincent -" -" -America -/ -Thunder_Bay -" -: -" -America -/ -Thunder_Bay -" -" -America -/ -Tortola -" -: -" -America -/ -Tortola -" -" -America -/ -Yellowknife -" -: -" -America -/ -Yellowknife -" -" -Antarctica -/ -DumontDUrville -" -: -" -Antarctica -/ -DumontDUrville -" -" -Antarctica -/ -McMurdo -" -: -" -Antarctica -/ -McMurdo -" -" -Antarctica -/ -Syowa -" -: -" -Antarctica -/ -Syowa -" -" -Asia -/ -Aden -" -: -" -Asia -/ -Aden -" -" -Asia -/ -Bahrain -" -: -" -Asia -/ -Bahrain -" -" -Asia -/ -Brunei -" -: -" -Asia -/ -Brunei -" -" -Asia -/ -Chongqing -" -: -" -Asia -/ -Chongqing -" -" -Asia -/ -Harbin -" -: -" -Asia -/ -Harbin -" -" -Asia -/ -Kashgar -" -: -" -Asia -/ -Kashgar -" -" -Asia -/ -Kuala_Lumpur -" -: -" -Asia -/ -Kuala_Lumpur -" -" -Asia -/ -Kuwait -" -: -" -Asia -/ -Kuwait -" -" -Asia -/ -Muscat -" -: -" -Asia -/ -Muscat -" -" -Asia -/ -Phnom_Penh -" -: -" -Asia -/ -Phnom_Penh -" -" -Asia -/ -Tel_Aviv -" -: -" -Asia -/ -Tel_Aviv -" -" -Asia -/ -Vientiane -" -: -" -Asia -/ -Vientiane -" -" -Atlantic -/ -Jan_Mayen -" -: -" -Atlantic -/ -Jan_Mayen -" -" -Atlantic -/ -Reykjavik -" -: -" -Atlantic -/ -Reykjavik -" -" -Atlantic -/ -St_Helena -" -: -" -Atlantic -/ -St_Helena -" -" -Australia -/ -Currie -" -: -" -Australia -/ -Currie -" -" -CET -" -: -" -CET -" -" -CST6CDT -" -: -" -CST6CDT -" -" -EET -" -: -" -EET -" -" -EST -" -: -" -EST -" -" -EST5EDT -" -: -" -EST5EDT -" -" -Europe -/ -Amsterdam -" -: -" -Europe -/ -Amsterdam -" -" -Europe -/ -Belfast -" -: -" -Europe -/ -Belfast -" -" -Europe -/ -Copenhagen -" -: -" -Europe -/ -Copenhagen -" -" -Europe -/ -Guernsey -" -: -" -Europe -/ -Guernsey -" -" -Europe -/ -Isle_of_Man -" -: -" -Europe -/ -Isle_of_Man -" -" -Europe -/ -Jersey -" -: -" -Europe -/ -Jersey -" -" -Europe -/ -Ljubljana -" -: -" -Europe -/ -Ljubljana -" -" -Europe -/ -Luxembourg -" -: -" -Europe -/ -Luxembourg -" -" -Europe -/ -Monaco -" -: -" -Europe -/ -Monaco -" -" -Europe -/ -Oslo -" -: -" -Europe -/ -Oslo -" -" -Europe -/ -Sarajevo -" -: -" -Europe -/ -Sarajevo -" -" -Europe -/ -Skopje -" -: -" -Europe -/ -Skopje -" -" -Europe -/ -Stockholm -" -: -" -Europe -/ -Stockholm -" -" -Europe -/ -Tiraspol -" -: -" -Europe -/ -Tiraspol -" -" -Europe -/ -Uzhgorod -" -: -" -Europe -/ -Uzhgorod -" -" -Europe -/ -Vaduz -" -: -" -Europe -/ -Vaduz -" -" -Europe -/ -Zagreb -" -: -" -Europe -/ -Zagreb -" -" -Europe -/ -Zaporozhye -" -: -" -Europe -/ -Zaporozhye -" -" -HST -" -: -" -HST -" -" -Indian -/ -Antananarivo -" -: -" -Indian -/ -Antananarivo -" -" -Indian -/ -Christmas -" -: -" -Indian -/ -Christmas -" -" -Indian -/ -Cocos -" -: -" -Indian -/ -Cocos -" -" -Indian -/ -Comoro -" -: -" -Indian -/ -Comoro -" -" -Indian -/ -Kerguelen -" -: -" -Indian -/ -Kerguelen -" -" -Indian -/ -Mahe -" -: -" -Indian -/ -Mahe -" -" -Indian -/ -Mayotte -" -: -" -Indian -/ -Mayotte -" -" -Indian -/ -Reunion -" -: -" -Indian -/ -Reunion -" -" -MET -" -: -" -MET -" -" -MST -" -: -" -MST -" -" -MST7MDT -" -: -" -MST7MDT -" -" -PST8PDT -" -: -" -PST8PDT -" -" -Pacific -/ -Chuuk -" -: -" -Pacific -/ -Chuuk -" -" -Pacific -/ -Enderbury -" -: -" -Pacific -/ -Enderbury -" -" -Pacific -/ -Funafuti -" -: -" -Pacific -/ -Funafuti -" -" -Pacific -/ -Johnston -" -: -" -Pacific -/ -Johnston -" -" -Pacific -/ -Majuro -" -: -" -Pacific -/ -Majuro -" -" -Pacific -/ -Midway -" -: -" -Pacific -/ -Midway -" -" -Pacific -/ -Pohnpei -" -: -" -Pacific -/ -Pohnpei -" -" -Pacific -/ -Saipan -" -: -" -Pacific -/ -Saipan -" -" -Pacific -/ -Wake -" -: -" -Pacific -/ -Wake -" -" -Pacific -/ -Wallis -" -: -" -Pacific -/ -Wallis -" -" -WET -" -: -" -WET -" -} -; -for -( -let -[ -linkName -target -] -of -Object -. -entries -( -links -) -) -{ -if -( -target -= -= -= -" -Etc -/ -UTC -" -| -| -target -= -= -= -" -Etc -/ -GMT -" -) -target -= -" -UTC -" -; -for -( -let -map -of -tzMapper -) -{ -let -dtf -= -new -Intl -. -DateTimeFormat -( -undefined -{ -timeZone -: -map -( -linkName -) -} -) -; -let -resolvedTimeZone -= -dtf -. -resolvedOptions -( -) -. -timeZone -; -assertEq -( -resolvedTimeZone -target -{ -linkName -} -- -> -{ -target -} -) -; -} -} -if -( -typeof -reportCompare -= -= -= -" -function -" -) -reportCompare -( -0 -0 -" -ok -" -) -; diff --git a/js/src/tests/non262/Intl/DateTimeFormat/timeZone_backzone_links.js b/js/src/tests/non262/Intl/DateTimeFormat/timeZone_backzone_links.js deleted file mode 100644 index bd9948167698b..0000000000000 --- a/js/src/tests/non262/Intl/DateTimeFormat/timeZone_backzone_links.js +++ /dev/null @@ -1,292 +0,0 @@ -const -tzMapper -= -[ -x -= -> -x -x -= -> -x -. -toUpperCase -( -) -x -= -> -x -. -toLowerCase -( -) -] -; -const -links -= -{ -" -Africa -/ -Asmera -" -: -" -Africa -/ -Asmara -" -" -America -/ -Kralendijk -" -: -" -America -/ -Curacao -" -" -America -/ -Lower_Princes -" -: -" -America -/ -Curacao -" -" -America -/ -Marigot -" -: -" -America -/ -Port_of_Spain -" -" -America -/ -St_Barthelemy -" -: -" -America -/ -Port_of_Spain -" -" -America -/ -Virgin -" -: -" -America -/ -St_Thomas -" -" -Antarctica -/ -South_Pole -" -: -" -Antarctica -/ -McMurdo -" -" -Arctic -/ -Longyearbyen -" -: -" -Europe -/ -Oslo -" -" -Asia -/ -Chungking -" -: -" -Asia -/ -Chongqing -" -" -Iceland -" -: -" -Atlantic -/ -Reykjavik -" -" -Pacific -/ -Ponape -" -: -" -Pacific -/ -Pohnpei -" -" -Pacific -/ -Truk -" -: -" -Pacific -/ -Chuuk -" -" -Pacific -/ -Yap -" -: -" -Pacific -/ -Chuuk -" -} -; -for -( -let -[ -linkName -target -] -of -Object -. -entries -( -links -) -) -{ -if -( -target -= -= -= -" -Etc -/ -UTC -" -| -| -target -= -= -= -" -Etc -/ -GMT -" -) -target -= -" -UTC -" -; -for -( -let -map -of -tzMapper -) -{ -let -dtf -= -new -Intl -. -DateTimeFormat -( -undefined -{ -timeZone -: -map -( -linkName -) -} -) -; -let -resolvedTimeZone -= -dtf -. -resolvedOptions -( -) -. -timeZone -; -assertEq -( -resolvedTimeZone -target -{ -linkName -} -- -> -{ -target -} -) -; -} -} -if -( -typeof -reportCompare -= -= -= -" -function -" -) -reportCompare -( -0 -0 -" -ok -" -) -; diff --git a/js/src/tests/non262/Intl/DateTimeFormat/timeZone_backward_links.js b/js/src/tests/non262/Intl/DateTimeFormat/timeZone_links.js similarity index 82% rename from js/src/tests/non262/Intl/DateTimeFormat/timeZone_backward_links.js rename to js/src/tests/non262/Intl/DateTimeFormat/timeZone_links.js index c849c6c8abe66..8ea03355eee7c 100644 --- a/js/src/tests/non262/Intl/DateTimeFormat/timeZone_backward_links.js +++ b/js/src/tests/non262/Intl/DateTimeFormat/timeZone_links.js @@ -40,6 +40,32 @@ Africa Asmara " " +Africa +/ +Timbuktu +" +: +" +Africa +/ +Bamako +" +" +America +/ +Argentina +/ +ComodRivadavia +" +: +" +America +/ +Argentina +/ +Catamarca +" +" America / Atka @@ -79,6 +105,17 @@ Catamarca " America / +Coral_Harbour +" +: +" +America +/ +Atikokan +" +" +America +/ Cordoba " : @@ -92,6 +129,17 @@ Cordoba " America / +Ensenada +" +: +" +America +/ +Tijuana +" +" +America +/ Fort_Wayne " : @@ -155,61 +203,61 @@ Knox " America / -Kralendijk +Louisville " : " America / -Curacao +Kentucky +/ +Louisville " " America / -Louisville +Mendoza " : " America / -Kentucky +Argentina / -Louisville +Mendoza " " America / -Lower_Princes +Montreal " : " America / -Curacao +Toronto " " America / -Marigot +Nipigon " : " America / -Port_of_Spain +Toronto " " America / -Mendoza +Pangnirtung " : " America / -Argentina -/ -Mendoza +Iqaluit " " America @@ -225,6 +273,30 @@ Rio_Branco " America / +Rainy_River +" +: +" +America +/ +Winnipeg +" +" +America +/ +Rosario +" +: +" +America +/ +Argentina +/ +Cordoba +" +" +America +/ Santa_Isabel " : @@ -247,13 +319,13 @@ Denver " America / -St_Barthelemy +Thunder_Bay " : " America / -Port_of_Spain +Toronto " " America @@ -267,26 +339,26 @@ America St_Thomas " " -Antarctica +America / -South_Pole +Yellowknife " : " -Antarctica +America / -McMurdo +Edmonton " " -Arctic +Antarctica / -Longyearbyen +South_Pole " : " -Europe +Antarctica / -Oslo +McMurdo " " Asia @@ -324,13 +396,24 @@ Ulaanbaatar " Asia / +Chongqing +" +: +" +Asia +/ +Shanghai +" +" +Asia +/ Chungking " : " Asia / -Chongqing +Shanghai " " Asia @@ -346,6 +429,17 @@ Dhaka " Asia / +Harbin +" +: +" +Asia +/ +Shanghai +" +" +Asia +/ Istanbul " : @@ -357,6 +451,17 @@ Istanbul " Asia / +Kashgar +" +: +" +Asia +/ +Urumqi +" +" +Asia +/ Katmandu " : @@ -401,6 +506,17 @@ Ho_Chi_Minh " Asia / +Tel_Aviv +" +: +" +Asia +/ +Jerusalem +" +" +Asia +/ Thimbu " : @@ -443,6 +559,17 @@ Atlantic Faroe " " +Atlantic +/ +Jan_Mayen +" +: +" +Arctic +/ +Longyearbyen +" +" Australia / ACT @@ -467,6 +594,17 @@ Sydney " Australia / +Currie +" +: +" +Australia +/ +Hobart +" +" +Australia +/ LHI " : @@ -608,6 +746,24 @@ America Manaus " " +CET +" +: +" +Europe +/ +Brussels +" +" +CST6CDT +" +: +" +America +/ +Chicago +" +" Canada / Atlantic @@ -727,6 +883,33 @@ America Havana " " +EET +" +: +" +Europe +/ +Athens +" +" +EST +" +: +" +America +/ +Panama +" +" +EST5EDT +" +: +" +America +/ +New_York +" +" Egypt " : @@ -748,14 +931,21 @@ Dublin Etc / GMT -+ -0 " : " +UTC +" +" Etc / GMT ++ +0 +" +: +" +UTC " " Etc @@ -766,9 +956,7 @@ GMT " : " -Etc -/ -GMT +UTC " " Etc @@ -777,9 +965,7 @@ GMT0 " : " -Etc -/ -GMT +UTC " " Etc @@ -788,9 +974,7 @@ Greenwich " : " -Etc -/ -GMT +UTC " " Etc @@ -799,53 +983,45 @@ UCT " : " -Etc -/ UTC " " Etc / -Universal +UTC " : " -Etc -/ UTC " " Etc / -Zulu +Universal " : " -Etc -/ UTC " " -Europe +Etc / -Bratislava +Zulu " : " -Europe -/ -Prague +UTC " " Europe / -Busingen +Belfast " : " Europe / -Zurich +London " " Europe @@ -861,17 +1037,6 @@ Kyiv " Europe / -Mariehamn -" -: -" -Europe -/ -Helsinki -" -" -Europe -/ Nicosia " : @@ -883,35 +1048,35 @@ Nicosia " Europe / -Podgorica +Tiraspol " : " Europe / -Belgrade +Chisinau " " Europe / -San_Marino +Uzhgorod " : " Europe / -Rome +Kyiv " " Europe / -Vatican +Zaporozhye " : " Europe / -Rome +Kyiv " " GB @@ -935,14 +1100,19 @@ London " " GMT +" +: +" +UTC +" +" +GMT + 0 " : " -Etc -/ -GMT +UTC " " GMT @@ -951,27 +1121,30 @@ GMT " : " -Etc -/ -GMT +UTC " " GMT0 " : " -Etc -/ -GMT +UTC " " Greenwich " : " -Etc +UTC +" +" +HST +" +: +" +Pacific / -GMT +Honolulu " " Hongkong @@ -1046,6 +1219,33 @@ Africa Tripoli " " +MET +" +: +" +Europe +/ +Brussels +" +" +MST +" +: +" +America +/ +Phoenix +" +" +MST7MDT +" +: +" +America +/ +Denver +" +" Mexico / BajaNorte @@ -1117,6 +1317,37 @@ Asia Shanghai " " +PST8PDT +" +: +" +America +/ +Los_Angeles +" +" +Pacific +/ +Enderbury +" +: +" +Pacific +/ +Kanton +" +" +Pacific +/ +Johnston +" +: +" +Pacific +/ +Honolulu +" +" Pacific / Ponape @@ -1219,8 +1450,6 @@ UCT " : " -Etc -/ UTC " " @@ -1364,41 +1593,37 @@ Pacific Pago_Pago " " -UTC +Universal " : " -Etc -/ UTC " " -Universal +W +- +SU " : " -Etc +Europe / -UTC +Moscow " " -W -- -SU +WET " : " Europe / -Moscow +Lisbon " " Zulu " : " -Etc -/ UTC " } diff --git a/js/src/tests/non262/Intl/DateTimeFormat/timeZone_notbackward_links.js b/js/src/tests/non262/Intl/DateTimeFormat/timeZone_notbackward_links.js deleted file mode 100644 index c7ee76a8c9619..0000000000000 --- a/js/src/tests/non262/Intl/DateTimeFormat/timeZone_notbackward_links.js +++ /dev/null @@ -1,160 +0,0 @@ -const -tzMapper -= -[ -x -= -> -x -x -= -> -x -. -toUpperCase -( -) -x -= -> -x -. -toLowerCase -( -) -] -; -const -links -= -{ -" -GMT -" -: -" -Etc -/ -GMT -" -} -; -for -( -let -[ -linkName -target -] -of -Object -. -entries -( -links -) -) -{ -if -( -target -= -= -= -" -Etc -/ -UTC -" -| -| -target -= -= -= -" -Etc -/ -GMT -" -) -target -= -" -UTC -" -; -for -( -let -map -of -tzMapper -) -{ -let -dtf -= -new -Intl -. -DateTimeFormat -( -undefined -{ -timeZone -: -map -( -linkName -) -} -) -; -let -resolvedTimeZone -= -dtf -. -resolvedOptions -( -) -. -timeZone -; -assertEq -( -resolvedTimeZone -target -{ -linkName -} -- -> -{ -target -} -) -; -} -} -if -( -typeof -reportCompare -= -= -= -" -function -" -) -reportCompare -( -0 -0 -" -ok -" -) -; diff --git a/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js b/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js index 2ff7351fcb8b7..aa510625547b8 100644 --- a/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js +++ b/js/src/tests/non262/Intl/DateTimeFormat/tz-environment-variable.js @@ -38,6 +38,13 @@ id " EST5EDT " +normalized +: +" +America +/ +New_York +" } { id @@ -45,6 +52,13 @@ id " CST6CDT " +normalized +: +" +America +/ +Chicago +" } { id @@ -52,6 +66,13 @@ id " MST7MDT " +normalized +: +" +America +/ +Denver +" } { id @@ -59,6 +80,13 @@ id " PST8PDT " +normalized +: +" +America +/ +Los_Angeles +" } { id diff --git a/js/src/tests/non262/Intl/supportedValuesOf-timeZones-canonical.js b/js/src/tests/non262/Intl/supportedValuesOf-timeZones-canonical.js index bebb892e2f48d..a096bc590c77a 100644 --- a/js/src/tests/non262/Intl/supportedValuesOf-timeZones-canonical.js +++ b/js/src/tests/non262/Intl/supportedValuesOf-timeZones-canonical.js @@ -252,11 +252,6 @@ Sao_Tome " Africa / -Timbuktu -" -" -Africa -/ Tripoli " " @@ -313,13 +308,6 @@ America / Argentina / -ComodRivadavia -" -" -America -/ -Argentina -/ Cordoba " " @@ -495,11 +483,6 @@ Ciudad_Juarez " America / -Coral_Harbour -" -" -America -/ Costa_Rica " " @@ -565,11 +548,6 @@ El_Salvador " America / -Ensenada -" -" -America -/ Fort_Nelson " " @@ -725,6 +703,11 @@ Monticello " America / +Kralendijk +" +" +America +/ La_Paz " " @@ -740,6 +723,11 @@ Los_Angeles " America / +Lower_Princes +" +" +America +/ Maceio " " @@ -755,6 +743,11 @@ Manaus " America / +Marigot +" +" +America +/ Martinique " " @@ -810,11 +803,6 @@ Montevideo " America / -Montreal -" -" -America -/ Montserrat " " @@ -830,11 +818,6 @@ New_York " America / -Nipigon -" -" -America -/ Nome " " @@ -881,11 +864,6 @@ Panama " America / -Pangnirtung -" -" -America -/ Paramaribo " " @@ -925,11 +903,6 @@ Punta_Arenas " America / -Rainy_River -" -" -America -/ Rankin_Inlet " " @@ -955,11 +928,6 @@ Rio_Branco " America / -Rosario -" -" -America -/ Santarem " " @@ -990,6 +958,11 @@ Sitka " America / +St_Barthelemy +" +" +America +/ St_Johns " " @@ -1030,11 +1003,6 @@ Thule " America / -Thunder_Bay -" -" -America -/ Tijuana " " @@ -1068,11 +1036,6 @@ America Yakutat " " -America -/ -Yellowknife -" -" Antarctica / Casey @@ -1128,6 +1091,11 @@ Antarctica Vostok " " +Arctic +/ +Longyearbyen +" +" Asia / Aden @@ -1215,11 +1183,6 @@ Chita " Asia / -Chongqing -" -" -Asia -/ Colombo " " @@ -1260,11 +1223,6 @@ Gaza " Asia / -Harbin -" -" -Asia -/ Hebron " " @@ -1320,11 +1278,6 @@ Karachi " Asia / -Kashgar -" -" -Asia -/ Kathmandu " " @@ -1495,11 +1448,6 @@ Tehran " Asia / -Tel_Aviv -" -" -Asia -/ Thimphu " " @@ -1587,11 +1535,6 @@ Faroe " Atlantic / -Jan_Mayen -" -" -Atlantic -/ Madeira " " @@ -1632,11 +1575,6 @@ Broken_Hill " Australia / -Currie -" -" -Australia -/ Darwin " " @@ -1675,21 +1613,6 @@ Australia Sydney " " -CET -" -" -CST6CDT -" -" -EET -" -" -EST -" -" -EST5EDT -" -" Etc / GMT @@ -1894,17 +1817,17 @@ Athens " Europe / -Belfast +Belgrade " " Europe / -Belgrade +Berlin " " Europe / -Berlin +Bratislava " " Europe @@ -1924,6 +1847,11 @@ Budapest " Europe / +Busingen +" +" +Europe +/ Chisinau " " @@ -2014,6 +1942,11 @@ Malta " Europe / +Mariehamn +" +" +Europe +/ Minsk " " @@ -2039,6 +1972,11 @@ Paris " Europe / +Podgorica +" +" +Europe +/ Prague " " @@ -2059,6 +1997,11 @@ Samara " Europe / +San_Marino +" +" +Europe +/ Sarajevo " " @@ -2099,22 +2042,17 @@ Tirane " Europe / -Tiraspol -" -" -Europe -/ Ulyanovsk " " Europe / -Uzhgorod +Vaduz " " Europe / -Vaduz +Vatican " " Europe @@ -2144,20 +2082,9 @@ Zagreb " Europe / -Zaporozhye -" -" -Europe -/ Zurich " " -Factory -" -" -HST -" -" Indian / Antananarivo @@ -2213,18 +2140,6 @@ Indian Reunion " " -MET -" -" -MST -" -" -MST7MDT -" -" -PST8PDT -" -" Pacific / Apia @@ -2262,11 +2177,6 @@ Efate " Pacific / -Enderbury -" -" -Pacific -/ Fakaofo " " @@ -2307,11 +2217,6 @@ Honolulu " Pacific / -Johnston -" -" -Pacific -/ Kanton " " @@ -2427,9 +2332,6 @@ Wallis " UTC " -" -WET -" ] ; let