tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

timeZones-include-non-continental.js (1579B)


      1 // Copyright 2025 Igalia, S.L. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-availableprimarytimezoneidentifiers
      5 description: >
      6  AvailablePrimaryTimeZoneIdentifiers doesn't perform any kind of filtering on
      7  the time zone IDs returned therefore time zone IDs for time zones that don't
      8  correspond to any continent like the Etc/* timezones as well as UTC should be
      9  included in this list.
     10 info: |
     11  6.5.3 AvailablePrimaryTimeZoneIdentifiers ( )
     12 
     13  1. Let records be AvailableNamedTimeZoneIdentifiers().
     14  2. Let result be a new empty List.
     15  3. For each element timeZoneIdentifierRecord of records, do
     16    a. If timeZoneIdentifierRecord.[[Identifier]] is timeZoneIdentifierRecord.[[PrimaryIdentifier]], then
     17      i. Append timeZoneIdentifierRecord.[[Identifier]] to result.
     18  4. Return result.
     19 features: [Intl-enumeration]
     20 ---*/
     21 
     22 const nonContinentalTimeZones = [
     23  "Etc/GMT+1",
     24  "Etc/GMT+2",
     25  "Etc/GMT+3",
     26  "Etc/GMT+4",
     27  "Etc/GMT+5",
     28  "Etc/GMT+6",
     29  "Etc/GMT+7",
     30  "Etc/GMT+8",
     31  "Etc/GMT+9",
     32  "Etc/GMT+10",
     33  "Etc/GMT+11",
     34  "Etc/GMT+12",
     35  "Etc/GMT-1",
     36  "Etc/GMT-2",
     37  "Etc/GMT-3",
     38  "Etc/GMT-4",
     39  "Etc/GMT-5",
     40  "Etc/GMT-6",
     41  "Etc/GMT-7",
     42  "Etc/GMT-8",
     43  "Etc/GMT-9",
     44  "Etc/GMT-10",
     45  "Etc/GMT-11",
     46  "Etc/GMT-12",
     47  "Etc/GMT-13",
     48  "Etc/GMT-14",
     49  "UTC",
     50 ];
     51 
     52 const supportedTimeZones = Intl.supportedValuesOf("timeZone");
     53 
     54 for (const tz of nonContinentalTimeZones) {
     55  assert(
     56    supportedTimeZones.includes(tz),
     57    `non-continental timezone ${tz} is not supported`,
     58  );
     59 }
     60 
     61 reportCompare(0, 0);