Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ba8ac6a
Editorial: Add and use definitions for ASCII-specific operations
gibson042 Dec 16, 2021
72ba19e
Editorial: Reposition note about non-ASCII case folding
gibson042 Dec 16, 2021
bfc5743
Editorial: Fix and simplify algorithm steps
gibson042 Dec 16, 2021
815ca02
Editorial: Document CanonicalCodeForDisplayNames argument types
gibson042 Dec 16, 2021
130d7d1
Editorial: Standardize the spelling of "uppercase" and "lowercase"
gibson042 Dec 16, 2021
b450fc9
Editorial: Add "!" before infallible calls
gibson042 Mar 17, 2022
f1fa3a6
Editorial: "!"-prefix ArrayCreate calls
gibson042 Mar 23, 2022
e52149c
Editorial: "!"-prefix OrdinaryObjectCreate calls
gibson042 Mar 23, 2022
f43d81b
Editorial: Replace errant %ObjectPrototype% with %Object.prototype%
gibson042 Mar 23, 2022
2ecf067
Editorial: "!"-prefix calls relating to ListFormat
gibson042 Mar 23, 2022
152ed46
Editorial: "!"-prefix CreateArrayFromList calls
gibson042 Mar 23, 2022
e5b6ccc
Editorial: Identify the sanctioned units as a subset of CLDR unit val…
gibson042 Sep 9, 2021
b5f746a
Editorial: Correctly use UTS #35 terms
gibson042 Sep 9, 2021
af760a4
Editorial: Improve diction
gibson042 Sep 9, 2021
01b7e7f
Editorial: Improve IsWellFormedUnitIdentifier algorithm steps
gibson042 Sep 9, 2021
08b7a6b
Editorial: Accept vocabulary suggestion
gibson042 Jan 9, 2022
c13a7a5
Editorial: Consistently use "sanctioned" rather "supported"
gibson042 Jan 9, 2022
f2fadab
Editorial: Rename operations and sections to align with UTS 35
gibson042 Jan 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ <h1>ToDateTimeOptions ( _options_, _required_, _defaults_ )</h1>

<emu-alg>
1. If _options_ is *undefined*, let _options_ be *null*; otherwise let _options_ be ? ToObject(_options_).
1. Let _options_ be OrdinaryObjectCreate(_options_).
1. Let _options_ be ! OrdinaryObjectCreate(_options_).
1. Let _needDefaults_ be *true*.
1. If _required_ is *"date"* or *"any"*, then
1. For each property name _prop_ of &laquo; *"weekday"*, *"year"*, *"month"*, *"day"* &raquo;, do
Expand Down Expand Up @@ -920,16 +920,16 @@ <h1>FormatDateTimePattern ( _dateTimeFormat_, _patternParts_, _x_, _rangeFormatO
1. Let _x_ be TimeClip(_x_).
1. If _x_ is *NaN*, throw a *RangeError* exception.
1. Let _locale_ be _dateTimeFormat_.[[Locale]].
1. Let _nfOptions_ be OrdinaryObjectCreate(*null*).
1. Let _nfOptions_ be ! OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nfOptions_, *"useGrouping"*, *false*).
1. Let _nf_ be ? Construct(%NumberFormat%, &laquo; _locale_, _nfOptions_ &raquo;).
1. Let _nf2Options_ be OrdinaryObjectCreate(*null*).
1. Let _nf2Options_ be ! OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"minimumIntegerDigits"*, 2).
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"useGrouping"*, *false*).
1. Let _nf2_ be ? Construct(%NumberFormat%, &laquo; _locale_, _nf2Options_ &raquo;).
1. Let _fractionalSecondDigits_ be _dateTimeFormat_.[[FractionalSecondDigits]].
1. If _fractionalSecondDigits_ is not *undefined*, then
1. Let _nf3Options_ be OrdinaryObjectCreate(*null*).
1. Let _nf3Options_ be ! OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"minimumIntegerDigits"*, _fractionalSecondDigits_).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"useGrouping"*, *false*).
1. Let _nf3_ be ? Construct(%NumberFormat%, &laquo; _locale_, _nf3Options_ &raquo;).
Expand Down Expand Up @@ -1040,10 +1040,10 @@ <h1>FormatDateTimeToParts ( _dateTimeFormat_, _x_ )</h1>

<emu-alg>
1. Let _parts_ be ? PartitionDateTimePattern(_dateTimeFormat_, _x_).
1. Let _result_ be ArrayCreate(0).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Let _O_ be ! OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
1. Perform ! CreateDataProperty(_result_, ! ToString(_n_), _O_).
Expand Down Expand Up @@ -1153,10 +1153,10 @@ <h1>FormatDateTimeRangeToParts ( _dateTimeFormat_, _x_, _y_ )</h1>

<emu-alg>
1. Let _parts_ be ? PartitionDateTimeRangePattern(_dateTimeFormat_, _x_, _y_).
1. Let _result_ be ArrayCreate(0).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ in _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%ObjectPrototype%).
1. Let _O_ be ! OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"source"*, _part_.[[Source]]).
Expand Down
22 changes: 10 additions & 12 deletions spec/displaynames.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,34 +248,32 @@ <h1>Abstract Operations for DisplayNames Objects</h1>
<emu-clause id="sec-canonicalcodefordisplaynames" aoid="CanonicalCodeForDisplayNames">
<h1>CanonicalCodeForDisplayNames ( _type_, _code_ )</h1>
<p>
The CanonicalCodeForDisplayNames abstract operation is called with arguments _type_ and _code_. It verifies that the _code_ argument represents a well-formed code according to the _type_ argument and returns the case-regularized form of the _code_. The algorithm refers to <a href="https://www.unicode.org/reports/tr35/#Identifiers">UTS 35's Unicode Language and Locale Identifiers grammar</a>. The following steps are taken:
The CanonicalCodeForDisplayNames abstract operation takes arguments _type_ (a String) and _code_ (a String). It verifies that the _code_ argument represents a well-formed code according to the _type_ argument and returns the case-regularized form of the _code_. The algorithm refers to <a href="https://www.unicode.org/reports/tr35/#Identifiers">UTS 35's Unicode Language and Locale Identifiers grammar</a>. The following steps are taken:
</p>
<emu-alg>
1. If _type_ is *"language"*, then
1. If _code_ does not match the `unicode_language_id` production, throw a *RangeError* exception.
1. If IsStructurallyValidLanguageTag(_code_) is *false*, throw a *RangeError* exception.
1. Set _code_ to CanonicalizeUnicodeLocaleId(_code_).
1. Return _code_.
1. If ! IsStructurallyValidLanguageTag(_code_) is *false*, throw a *RangeError* exception.
1. Return ! CanonicalizeUnicodeLocaleId(_code_).
1. If _type_ is *"region"*, then
1. If _code_ does not match the `unicode_region_subtag` production, throw a *RangeError* exception.
1. Let _code_ be the result of mapping _code_ to upper case as described in <emu-xref href="#sec-case-sensitivity-and-case-mapping"></emu-xref>.
1. Return _code_.
1. Return the ASCII-uppercase of _code_.
1. If _type_ is *"script"*, then
1. If _code_ does not match the `unicode_script_subtag` production, throw a *RangeError* exception.
1. Let _code_ be the result of mapping the first character in _code_ to upper case, and mapping the second, third, and fourth character in _code_ to lower case, as described in <emu-xref href="#sec-case-sensitivity-and-case-mapping"></emu-xref>.
1. Return _code_.
1. Assert: The length of _code_ is 4, and every code unit of _code_ represents an ASCII letter (0x0041 through 0x005A and 0x0061 through 0x007A, both inclusive).
1. Let _first_ be the ASCII-uppercase of the substring of _code_ from 0 to 1.
1. Let _rest_ be the ASCII-lowercase of the substring of _code_ from 1.
1. Return the string-concatenation of _first_ and _rest_.
1. If _type_ is *"calendar"*, then
1. If _code_ does not match the Unicode Locale Identifier `type` nonterminal, throw a *RangeError* exception.
1. If _code_ uses any of the backwards compatibility syntax described in <a href="https://unicode.org/reports/tr35/#BCP_47_Conformance">Unicode Technical Standard #35 LDML § 3.3 BCP 47 Conformance</a>, throw a *RangeError* exception.
1. Let _code_ be the result of mapping _code_ to lower case as described in <emu-xref href="#sec-case-sensitivity-and-case-mapping"></emu-xref>.
1. Return _code_.
1. Return the ASCII-lowercase of _code_.
1. If _type_ is *"dateTimeField"*, then
1. If the result of IsValidDateTimeFieldCode(_code_) is *false*, throw a *RangeError* exception.
1. Return _code_.
1. Assert: _type_ is *"currency"*.
1. If ! IsWellFormedCurrencyCode(_code_) is *false*, throw a *RangeError* exception.
1. Let _code_ be the result of mapping _code_ to upper case as described in <emu-xref href="#sec-case-sensitivity-and-case-mapping"></emu-xref>.
1. Return _code_.
1. Return the ASCII-uppercase of _code_.
</emu-alg>
</emu-clause>

Expand Down
2 changes: 1 addition & 1 deletion spec/intl.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h1>Intl.getCanonicalLocales ( _locales_ )</h1>

<emu-alg>
1. Let _ll_ be ? CanonicalizeLocaleList(_locales_).
1. Return CreateArrayFromList(_ll_).
1. Return ! CreateArrayFromList(_ll_).
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down
18 changes: 9 additions & 9 deletions spec/listformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h1>Intl.ListFormat.prototype.format ( _list_ )</h1>
1. Let _lf_ be the *this* value.
1. Perform ? RequireInternalSlot(_lf_, [[InitializedListFormat]]).
1. Let _stringList_ be ? StringListFromIterable(_list_).
1. Return FormatList(_lf_, _stringList_).
1. Return ! FormatList(_lf_, _stringList_).
</emu-alg>
</emu-clause>

Expand All @@ -157,7 +157,7 @@ <h1>Intl.ListFormat.prototype.formatToParts ( _list_ )</h1>
1. Let _lf_ be the *this* value.
1. Perform ? RequireInternalSlot(_lf_, [[InitializedListFormat]]).
1. Let _stringList_ be ? StringListFromIterable(_list_).
1. Return FormatListToParts(_lf_, _stringList_).
1. Return ! FormatListToParts(_lf_, _stringList_).
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -259,7 +259,7 @@ <h1>DeconstructPattern ( _pattern_, _placeables_ )</h1>
&raquo;
</pre>
<emu-alg>
1. Let _patternParts_ be PartitionPattern(_pattern_).
1. Let _patternParts_ be ! PartitionPattern(_pattern_).
1. Let _result_ be a new empty List.
1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do
1. Let _part_ be _patternPart_.[[Type]].
Expand Down Expand Up @@ -296,7 +296,7 @@ <h1>CreatePartsFromList ( _listFormat_, _list_ )</h1>
1. Let _first_ be a new Record { [[Type]]: *"element"*, [[Value]]: _list_[0] }.
1. Let _second_ be a new Record { [[Type]]: *"element"*, [[Value]]: _list_[1] }.
1. Let _placeables_ be a new Record { [[0]]: _first_, [[1]]: _second_ }.
1. Return DeconstructPattern(_pattern_, _placeables_).
1. Return ! DeconstructPattern(_pattern_, _placeables_).
1. Let _last_ be a new Record { [[Type]]: *"element"*, [[Value]]: _list_[_size_ - 1] }.
1. Let _parts_ be &laquo; _last_ &raquo;.
1. Let _i_ be _size_ - 2.
Expand All @@ -310,7 +310,7 @@ <h1>CreatePartsFromList ( _listFormat_, _list_ )</h1>
1. Else,
1. Let _pattern_ be _listFormat_.[[Templates]][_n_].[[End]].
1. Let _placeables_ be a new Record { [[0]]: _head_, [[1]]: _parts_ }.
1. Set _parts_ to DeconstructPattern(_pattern_, _placeables_).
1. Set _parts_ to ! DeconstructPattern(_pattern_, _placeables_).
1. Decrement _i_ by 1.
1. Return _parts_.
</emu-alg>
Expand All @@ -328,7 +328,7 @@ <h1>FormatList ( _listFormat_, _list_ )</h1>
</p>

<emu-alg>
1. Let _parts_ be CreatePartsFromList(_listFormat_, _list_).
1. Let _parts_ be ! CreatePartsFromList(_listFormat_, _list_).
1. Let _result_ be an empty String.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
Expand All @@ -344,11 +344,11 @@ <h1>FormatListToParts ( _listFormat_, _list_ )</h1>
</p>

<emu-alg>
1. Let _parts_ be CreatePartsFromList(_listFormat_, _list_).
1. Let _result_ be ArrayCreate(0).
1. Let _parts_ be ! CreatePartsFromList(_listFormat_, _list_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Let _O_ be ! OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
1. Perform ! CreateDataPropertyOrThrow(_result_, ! ToString(_n_), _O_).
Expand Down
4 changes: 2 additions & 2 deletions spec/locale-sensitive-functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ <h1>
1. If _locale_ is *undefined*, set _locale_ to *"und"*.
1. Let _codePoints_ be ! StringToCodePoints(_S_).
1. If _targetCase_ is ~lower~, then
1. Let _newCodePoints_ be a List whose elements are the result of a lower case transformation of _codePoints_ according to an implementation-derived algorithm using _locale_ or the Unicode Default Case Conversion algorithm.
1. Let _newCodePoints_ be a List whose elements are the result of a lowercase transformation of _codePoints_ according to an implementation-derived algorithm using _locale_ or the Unicode Default Case Conversion algorithm.
1. Else,
1. Assert: _targetCase_ is ~upper~.
1. Let _newCodePoints_ be a List whose elements are the result of an upper case transformation of _codePoints_ according to an implementation-derived algorithm using _locale_ or the Unicode Default Case Conversion algorithm.
1. Let _newCodePoints_ be a List whose elements are the result of an uppercase transformation of _codePoints_ according to an implementation-derived algorithm using _locale_ or the Unicode Default Case Conversion algorithm.
1. Return ! CodePointsToString(_newCodePoints_).
</emu-alg>

Expand Down
6 changes: 3 additions & 3 deletions spec/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h1>ApplyOptionsToTag ( _tag_, _options_ )</h1>
<emu-alg>
1. Assert: Type(_tag_) is String.
1. Assert: Type(_options_) is Object.
1. If IsStructurallyValidLanguageTag(_tag_) is *false*, throw a *RangeError* exception.
1. If ! IsStructurallyValidLanguageTag(_tag_) is *false*, throw a *RangeError* exception.
1. Let _language_ be ? GetOption(_options_, *"language"*, *"string"*, *undefined*, *undefined*).
1. If _language_ is not *undefined*, then
1. If _language_ does not match the `unicode_language_subtag` production, throw a *RangeError* exception.
Expand All @@ -88,7 +88,7 @@ <h1>ApplyOptionsToTag ( _tag_, _options_ )</h1>
1. Let _region_ be ? GetOption(_options_, *"region"*, *"string"*, *undefined*, *undefined*).
1. If _region_ is not *undefined*, then
1. If _region_ does not match the `unicode_region_subtag` production, throw a *RangeError* exception.
1. Set _tag_ to CanonicalizeUnicodeLocaleId(_tag_).
1. Set _tag_ to ! CanonicalizeUnicodeLocaleId(_tag_).
1. Assert: _tag_ matches the `unicode_locale_id` production.
1. Let _languageId_ be the substring of _tag_ corresponding to the `unicode_language_id` production.
1. If _language_ is not *undefined*, then
Expand All @@ -104,7 +104,7 @@ <h1>ApplyOptionsToTag ( _tag_, _options_ )</h1>
1. Else,
1. Set _languageId_ to _languageId_ with the substring corresponding to the `unicode_region_subtag` production replaced by the string _region_.
1. Set _tag_ to _tag_ with the substring corresponding to the `unicode_language_id` production replaced by the string _languageId_.
1. Return CanonicalizeUnicodeLocaleId(_tag_).
1. Return ! CanonicalizeUnicodeLocaleId(_tag_).
</emu-alg>
</emu-clause>

Expand Down
Loading