Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -762,7 +762,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 @@ -921,16 +921,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 @@ -1041,10 +1041,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 @@ -1154,10 +1154,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
2 changes: 1 addition & 1 deletion spec/displaynames.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ <h1>CanonicalCodeForDisplayNames ( _type_, _code_ )</h1>
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. Set _code_ to ! CanonicalizeUnicodeLocaleId(_code_).
1. Return _code_.
1. If _type_ is *"region"*, then
1. If _code_ does not match the `unicode_region_subtag` production, throw a *RangeError* exception.
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
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given 262's completion reform, where most AOs don't need to return completions, would it make more sense to update 402 to match rather than adding a bunch of prefixes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, quite possibly. Do you have a sense of what that would like like here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d expect a separate PR that updates every AO to use the new signature, and ecmarkup will enforce that only those that return completion records are used with the ? or ! prefix - and predicates all don’t.

It’s probably a good amount of work, but it’s also probably a good idea to do before 2022, so the two 2022’s can match.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're hoping for the upcoming TC39 plenary to approve the 2022 spec, and my other open PRs have more material impact. I'd therefore like ECMA-402 completion reform to follow those, but only one is considered necessary for the 2022 edition so there probably won't be time to make the cutoff.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes sense, but i'm not actually sure the 402 spec is valid anymore since the implicit completion rules for AOs in the 262 spec it relies on no longer exist.

in other words, i'm not sure the 402 2022 spec can be cut until the completion reform is done :-/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the use of completion records in 262 was technically "invalid" for years, I don't think completion reform needs to block cutting the 2022 edition unless the current state is actually unclear to human readers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was it invalid?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completion records were described as only containing ECMAScript language values, but held many other types of values.

(Also the "Any reference to a Completion Record value that is in a context that does not explicitly require a complete Completion Record value is equivalent to an explicit reference to the [[Value]] field of the Completion Record value unless the Completion Record is an abrupt completion." wasn't really precise enough to be meaningful.)

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
20 changes: 10 additions & 10 deletions spec/negotiation.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1>CanonicalizeLocaleList ( _locales_ )</h1>
1. Return a new empty List.
1. Let _seen_ be a new empty List.
1. If Type(_locales_) is String or Type(_locales_) is Object and _locales_ has an [[InitializedLocale]] internal slot, then
1. Let _O_ be CreateArrayFromList(&laquo; _locales_ &raquo;).
1. Let _O_ be ! CreateArrayFromList(&laquo; _locales_ &raquo;).
1. Else,
1. Let _O_ be ? ToObject(_locales_).
1. Let _len_ be ? ToLength(? Get(_O_, *"length"*)).
Expand All @@ -59,8 +59,8 @@ <h1>CanonicalizeLocaleList ( _locales_ )</h1>
1. Let _tag_ be _kValue_.[[Locale]].
1. Else,
1. Let _tag_ be ? ToString(_kValue_).
1. If IsStructurallyValidLanguageTag(_tag_) is *false*, throw a *RangeError* exception.
1. Let _canonicalizedTag_ be CanonicalizeUnicodeLocaleId(_tag_).
1. If ! IsStructurallyValidLanguageTag(_tag_) is *false*, throw a *RangeError* exception.
1. Let _canonicalizedTag_ be ! CanonicalizeUnicodeLocaleId(_tag_).
1. If _canonicalizedTag_ is not an element of _seen_, append _canonicalizedTag_ as the last element of _seen_.
1. Increase _k_ by 1.
1. Return _seen_.
Expand Down Expand Up @@ -103,14 +103,14 @@ <h1>LookupMatcher ( _availableLocales_, _requestedLocales_ )</h1>
1. Let _result_ be a new Record.
1. For each element _locale_ of _requestedLocales_, do
1. Let _noExtensionsLocale_ be the String value that is _locale_ with any Unicode locale extension sequences removed.
1. Let _availableLocale_ be BestAvailableLocale(_availableLocales_, _noExtensionsLocale_).
1. Let _availableLocale_ be ! BestAvailableLocale(_availableLocales_, _noExtensionsLocale_).
1. If _availableLocale_ is not *undefined*, then
1. Set _result_.[[locale]] to _availableLocale_.
1. If _locale_ and _noExtensionsLocale_ are not the same String value, then
1. Let _extension_ be the String value consisting of the substring of the Unicode locale extension sequence within _locale_.
1. Set _result_.[[extension]] to _extension_.
1. Return _result_.
1. Let _defLocale_ be DefaultLocale().
1. Let _defLocale_ be ! DefaultLocale().
1. Set _result_.[[locale]] to _defLocale_.
1. Return _result_.
</emu-alg>
Expand Down Expand Up @@ -183,7 +183,7 @@ <h1>InsertUnicodeExtensionAndCanonicalize ( _locale_, _extension_ )</h1>
1. Let _preExtension_ be the substring of _locale_ from position 0, inclusive, to position _privateIndex_, exclusive.
1. Let _postExtension_ be the substring of _locale_ from position _privateIndex_ to the end of the string.
1. Let _locale_ be the string-concatenation of _preExtension_, _extension_, and _postExtension_.
1. Assert: IsStructurallyValidLanguageTag(_locale_) is *true*.
1. Assert: ! IsStructurallyValidLanguageTag(_locale_) is *true*.
1. Return ! CanonicalizeUnicodeLocaleId(_locale_).
</emu-alg>
</emu-clause>
Expand All @@ -202,9 +202,9 @@ <h1>ResolveLocale ( _availableLocales_, _requestedLocales_, _options_, _relevant
<emu-alg>
1. Let _matcher_ be _options_.[[localeMatcher]].
1. If _matcher_ is *"lookup"*, then
1. Let _r_ be LookupMatcher(_availableLocales_, _requestedLocales_).
1. Let _r_ be ! LookupMatcher(_availableLocales_, _requestedLocales_).
1. Else,
1. Let _r_ be BestFitMatcher(_availableLocales_, _requestedLocales_).
1. Let _r_ be ! BestFitMatcher(_availableLocales_, _requestedLocales_).
1. Let _foundLocale_ be _r_.[[locale]].
1. Let _result_ be a new Record.
1. Set _result_.[[dataLocale]] to _foundLocale_.
Expand Down Expand Up @@ -267,7 +267,7 @@ <h1>LookupSupportedLocales ( _availableLocales_, _requestedLocales_ )</h1>
1. Let _subset_ be a new empty List.
1. For each element _locale_ of _requestedLocales_, do
1. Let _noExtensionsLocale_ be the String value that is _locale_ with any Unicode locale extension sequences removed.
1. Let _availableLocale_ be BestAvailableLocale(_availableLocales_, _noExtensionsLocale_).
1. Let _availableLocale_ be ! BestAvailableLocale(_availableLocales_, _noExtensionsLocale_).
1. If _availableLocale_ is not *undefined*, append _locale_ to the end of _subset_.
1. Return _subset_.
</emu-alg>
Expand Down Expand Up @@ -295,7 +295,7 @@ <h1>SupportedLocales ( _availableLocales_, _requestedLocales_, _options_ )</h1>
1. Let _supportedLocales_ be BestFitSupportedLocales(_availableLocales_, _requestedLocales_).
1. Else,
1. Let _supportedLocales_ be LookupSupportedLocales(_availableLocales_, _requestedLocales_).
1. Return CreateArrayFromList(_supportedLocales_).
1. Return ! CreateArrayFromList(_supportedLocales_).
</emu-alg>
</emu-clause>

Expand Down
4 changes: 2 additions & 2 deletions spec/numberformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -1002,10 +1002,10 @@ <h1>FormatNumericToParts ( _numberFormat_, _x_ )</h1>

<emu-alg>
1. Let _parts_ be ? PartitionNumberPattern(_numberFormat_, _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 ! CreateDataPropertyOrThrow(_result_, ! ToString(_n_), _O_).
Expand Down
2 changes: 1 addition & 1 deletion spec/pluralrules.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h1>Intl.PluralRules.prototype.resolvedOptions ( )</h1>
1. If _v_ is not *undefined*, then
1. Perform ! CreateDataPropertyOrThrow(_options_, _p_, _v_).
1. Let _pluralCategories_ be a List of Strings containing all possible results of <emu-xref href="#sec-pluralruleselect">PluralRuleSelect</emu-xref> for the selected locale _pr_.[[Locale]].
1. Perform ! CreateDataProperty(_options_, *"pluralCategories"*, CreateArrayFromList(_pluralCategories_)).
1. Perform ! CreateDataProperty(_options_, *"pluralCategories"*, ! CreateArrayFromList(_pluralCategories_)).
1. Return _options_.
</emu-alg>

Expand Down
4 changes: 2 additions & 2 deletions spec/relativetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,10 @@ <h1>FormatRelativeTimeToParts ( _relativeTimeFormat_, _value_, _unit_ )</h1>

<emu-alg>
1. Let _parts_ be ? PartitionRelativeTimePattern(_relativeTimeFormat_, _value_, _unit_).
1. Let _result_ be ArrayCreate(0).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]], [[Unit]] } _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. If _part_.[[Unit]] is not ~empty~, then
Expand Down