From 81856b34cad7476119432979c7e351035b89bb30 Mon Sep 17 00:00:00 2001
From: Frank Yung-Fong Tang
Date: Mon, 3 Apr 2023 10:19:35 -0700
Subject: [PATCH] Normative: Stage4 PR for proposal-intl-enumeration (#716)
* Normative: Stage4 PR for proposal-intl-enumeration
Plan to suggest moving to Stage 4 in Nov 2022
https://github.com/tc39/proposal-intl-enumeration
It is already implemented in Chrome m99, Safari 15.4 and Firefox 93.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf#browser_compatibility
* sync w/ intl-enumeration pull/43
https://github.com/tc39/proposal-intl-enumeration/pull/43
* Update spec/locales-currencies-tz.html
Co-authored-by: Richard Gibson
* Update spec/locales-currencies-tz.html
Co-authored-by: Richard Gibson
* Update spec/locales-currencies-tz.html
Co-authored-by: Richard Gibson
* Update spec/locales-currencies-tz.html
Co-authored-by: Richard Gibson
* Update spec/locales-currencies-tz.html
Co-authored-by: Richard Gibson
* Update spec/locales-currencies-tz.html
Co-authored-by: Richard Gibson
* Update spec/locales-currencies-tz.html
Co-authored-by: Richard Gibson
* Update spec/locales-currencies-tz.html
Co-authored-by: Richard Gibson
---------
Co-authored-by: Richard Gibson
---
spec/intl.html | 27 ++++++++++
spec/locales-currencies-tz.html | 95 ++++++++++++++++++++++++++++++++-
2 files changed, 120 insertions(+), 2 deletions(-)
diff --git a/spec/intl.html b/spec/intl.html
index a6ff46b8..8a612be9 100644
--- a/spec/intl.html
+++ b/spec/intl.html
@@ -117,5 +117,32 @@ Intl.getCanonicalLocales ( _locales_ )
1. Return CreateArrayFromList(_ll_).
+
+
+ Intl.supportedValuesOf ( _key_ )
+
+
+ When the `supportedValuesOf` method is called with argument _key_ , the following steps are taken:
+
+
+
+ 1. Let _key_ be ? ToString(_key_).
+ 1. If _key_ is *"calendar"*, then
+ 1. Let _list_ be AvailableCanonicalCalendars( ).
+ 1. Else if _key_ is *"collation"*, then
+ 1. Let _list_ be AvailableCanonicalCollations( ).
+ 1. Else if _key_ is *"currency"*, then
+ 1. Let _list_ be AvailableCanonicalCurrencies( ).
+ 1. Else if _key_ is *"numberingSystem"*, then
+ 1. Let _list_ be AvailableCanonicalNumberingSystems( ).
+ 1. Else if _key_ is *"timeZone"*, then
+ 1. Let _list_ be AvailableCanonicalTimeZones( ).
+ 1. Else if _key_ is *"unit"*, then
+ 1. Let _list_ be AvailableCanonicalUnits( ).
+ 1. Else,
+ 1. Throw a *RangeError* exception.
+ 1. Return CreateArrayFromList( _list_ ).
+
+
diff --git a/spec/locales-currencies-tz.html b/spec/locales-currencies-tz.html
index ba321ab2..b35aada7 100644
--- a/spec/locales-currencies-tz.html
+++ b/spec/locales-currencies-tz.html
@@ -1,8 +1,8 @@
- Identification of Locales, Currencies, Time Zones, and Measurement Units
+ Identification of Locales, Currencies, Time Zones, Measurement Units, Numbering Systems, Collations, and Calendars
- This clause describes the String values used in the ECMAScript 2023 Internationalization API Specification to identify locales, currencies, time zones, and measurement units.
+ This clause describes the String values used in this specification to identify locales, currencies, time zones, measurement units, numbering systems, collations, and calendars.
@@ -159,6 +159,15 @@ IsWellFormedCurrencyCode ( _currency_ )
+
+ AvailableCanonicalCurrencies (
+ ): a List of Strings
+
+
+
Time Zone Names
@@ -218,6 +227,29 @@ DefaultTimeZone ( ): a String
This definition supersedes the definition provided in es2023, .
+
+
+
+ AvailableCanonicalTimeZones (
+ ): a List of Strings
+
+
+
+
+ 1. Let _names_ be a List of all Zone and Link names in the IANA Time Zone Database that are supported by the implementation.
+ 1. Let _result_ be a new empty List.
+ 1. For each element _name_ of _names_, do
+ 1. Assert: ! IsValidTimeZoneName( _name_ ) is *true*.
+ 1. Let _canonical_ be ! CanonicalizeTimeZoneName( _name_ ).
+ 1. If _result_ does not contain _canonical_, then
+ 1. Append _canonical_ to the end of _result_.
+ 1. [declared="comparefn"] Sort _result_ in order as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_.
+ 1. Return _result_.
+
+
@@ -322,5 +354,64 @@ IsSanctionedSingleUnitIdentifier ( _unitIdentifier_ )
+
+ AvailableCanonicalUnits (
+ ): a List of Strings
+
+
+
+
+
+ Numbering System Identifiers
+
+
+ This specification identifies numbering systems using a numbering system identifier corresponding with the name referenced by Unicode Technical Standard #35 Part 3 Numbers, Section 1 Numbering Systems. Their canonical form is a string containing only Unicode Basic Latin lowercase letters (U+0061 LATIN SMALL LETTER A through U+007A LATIN SMALL LETTER Z).
+
+
+
+ AvailableCanonicalNumberingSystems (
+ ): a List of Strings
+
+
+
+
+
+ Collation Types
+
+
+ This specification identifies collations using a collation type as defined by Unicode Technical Standard #35 Part 5 Collation, Section 3.1 Collation Types. Their canonical form is a string containing only Unicode Basic Latin lowercase letters (U+0061 LATIN SMALL LETTER A through U+007A LATIN SMALL LETTER Z) with zero or more medial hyphens (U+002D HYPHEN-MINUS).
+
+
+
+ AvailableCanonicalCollations (
+ ): a List of Strings
+
+
+
+
+
+ Calendar Types
+
+
+ This specification identifies calendars using a calendar type as defined by Unicode Technical Standard #35 Part 4 Dates, Section 2 Calendar Elements. Their canonical form is a string containing only Unicode Basic Latin lowercase letters (U+0061 LATIN SMALL LETTER A through U+007A LATIN SMALL LETTER Z) with zero or more medial hyphens (U+002D HYPHEN-MINUS).
+
+
+
+ AvailableCanonicalCalendars (
+ ): a List of Strings
+
+