Skip to content

Commit

Permalink
Editorial: ECMA-402 contents should be arranged more consistently tc3…
Browse files Browse the repository at this point in the history
…9#405

Alphabetize .prototype properties
  • Loading branch information
ben-allen committed Sep 12, 2024
1 parent 1cb5af3 commit 09eb2bf
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 151 deletions.
178 changes: 89 additions & 89 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -894,95 +894,6 @@ <h1>Intl.DateTimeFormat.prototype.constructor</h1>
</p>
</emu-clause>

<emu-clause id="sec-intl.datetimeformat.prototype-%symbol.tostringtag%" oldids="sec-intl.datetimeformat.prototype-@@tostringtag">
<h1>Intl.DateTimeFormat.prototype [ %Symbol.toStringTag% ]</h1>

<p>
The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DateTimeFormat"*.
</p>

<p>
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
</p>
</emu-clause>

<emu-clause id="sec-intl.datetimeformat.prototype.format">
<h1>get Intl.DateTimeFormat.prototype.format</h1>

<p>
Intl.DateTimeFormat.prototype.format is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
</p>

<emu-alg>
1. Let _dtf_ be the *this* value.
1. If the implementation supports the normative optional constructor mode of <emu-xref href="#legacy-constructor"></emu-xref>, then
1. Set _dtf_ to ? UnwrapDateTimeFormat(_dtf_).
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1. If _dtf_.[[BoundFormat]] is *undefined*, then
1. Let _F_ be a new built-in function object as defined in DateTime Format Functions (<emu-xref href="#sec-datetime-format-functions"></emu-xref>).
1. Set _F_.[[DateTimeFormat]] to _dtf_.
1. Set _dtf_.[[BoundFormat]] to _F_.
1. Return _dtf_.[[BoundFormat]].
</emu-alg>

<emu-note>
The returned function is bound to _dtf_ so that it can be passed directly to `Array.prototype.map` or other functions.
This is considered a historical artefact, as part of a convention which is no longer followed for new features, but is preserved to maintain compatibility with existing programs.
</emu-note>
</emu-clause>

<emu-clause id="sec-Intl.DateTimeFormat.prototype.formatToParts">
<h1>Intl.DateTimeFormat.prototype.formatToParts ( _date_ )</h1>

<p>
When the `formatToParts` method is called with an argument _date_, the following steps are taken:
</p>

<emu-alg>
1. Let _dtf_ be the *this* value.
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1. If _date_ is *undefined*, then
1. Let _x_ be ! Call(%Date.now%, *undefined*).
1. Else,
1. Let _x_ be ? ToNumber(_date_).
1. Return ? FormatDateTimeToParts(_dtf_, _x_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-intl.datetimeformat.prototype.formatRange">
<h1>Intl.DateTimeFormat.prototype.formatRange ( _startDate_, _endDate_ )</h1>

<p>
When the `formatRange` method is called with arguments _startDate_ and _endDate_, the following steps are taken:
</p>

<emu-alg>
1. Let _dtf_ be *this* value.
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1. If _startDate_ is *undefined* or _endDate_ is *undefined*, throw a *TypeError* exception.
1. Let _x_ be ? ToNumber(_startDate_).
1. Let _y_ be ? ToNumber(_endDate_).
1. Return ? FormatDateTimeRange(_dtf_, _x_, _y_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.DateTimeFormat.prototype.formatRangeToParts">
<h1>Intl.DateTimeFormat.prototype.formatRangeToParts ( _startDate_, _endDate_ )</h1>

<p>
When the `formatRangeToParts` method is called with arguments _startDate_ and _endDate_, the following steps are taken:
</p>

<emu-alg>
1. Let _dtf_ be *this* value.
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1. If _startDate_ is *undefined* or _endDate_ is *undefined*, throw a *TypeError* exception.
1. Let _x_ be ? ToNumber(_startDate_).
1. Let _y_ be ? ToNumber(_endDate_).
1. Return ? FormatDateTimeRangeToParts(_dtf_, _x_, _y_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-intl.datetimeformat.prototype.resolvedoptions">
<h1>Intl.DateTimeFormat.prototype.resolvedOptions ( )</h1>

Expand Down Expand Up @@ -1138,6 +1049,95 @@ <h1>Intl.DateTimeFormat.prototype.resolvedOptions ( )</h1>
For compatibility with versions prior to the fifth edition, the *"hour12"* property is set in addition to the *"hourCycle"* property.
</emu-note>
</emu-clause>

<emu-clause id="sec-intl.datetimeformat.prototype-%symbol.tostringtag%" oldids="sec-intl.datetimeformat.prototype-@@tostringtag">
<h1>Intl.DateTimeFormat.prototype [ %Symbol.toStringTag% ]</h1>

<p>
The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DateTimeFormat"*.
</p>

<p>
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
</p>
</emu-clause>

<emu-clause id="sec-intl.datetimeformat.prototype.format">
<h1>get Intl.DateTimeFormat.prototype.format</h1>

<p>
Intl.DateTimeFormat.prototype.format is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
</p>

<emu-alg>
1. Let _dtf_ be the *this* value.
1. If the implementation supports the normative optional constructor mode of <emu-xref href="#legacy-constructor"></emu-xref>, then
1. Set _dtf_ to ? UnwrapDateTimeFormat(_dtf_).
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1. If _dtf_.[[BoundFormat]] is *undefined*, then
1. Let _F_ be a new built-in function object as defined in DateTime Format Functions (<emu-xref href="#sec-datetime-format-functions"></emu-xref>).
1. Set _F_.[[DateTimeFormat]] to _dtf_.
1. Set _dtf_.[[BoundFormat]] to _F_.
1. Return _dtf_.[[BoundFormat]].
</emu-alg>

<emu-note>
The returned function is bound to _dtf_ so that it can be passed directly to `Array.prototype.map` or other functions.
This is considered a historical artefact, as part of a convention which is no longer followed for new features, but is preserved to maintain compatibility with existing programs.
</emu-note>
</emu-clause>

<emu-clause id="sec-intl.datetimeformat.prototype.formatRange">
<h1>Intl.DateTimeFormat.prototype.formatRange ( _startDate_, _endDate_ )</h1>

<p>
When the `formatRange` method is called with arguments _startDate_ and _endDate_, the following steps are taken:
</p>

<emu-alg>
1. Let _dtf_ be *this* value.
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1. If _startDate_ is *undefined* or _endDate_ is *undefined*, throw a *TypeError* exception.
1. Let _x_ be ? ToNumber(_startDate_).
1. Let _y_ be ? ToNumber(_endDate_).
1. Return ? FormatDateTimeRange(_dtf_, _x_, _y_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.DateTimeFormat.prototype.formatRangeToParts">
<h1>Intl.DateTimeFormat.prototype.formatRangeToParts ( _startDate_, _endDate_ )</h1>

<p>
When the `formatRangeToParts` method is called with arguments _startDate_ and _endDate_, the following steps are taken:
</p>

<emu-alg>
1. Let _dtf_ be *this* value.
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1. If _startDate_ is *undefined* or _endDate_ is *undefined*, throw a *TypeError* exception.
1. Let _x_ be ? ToNumber(_startDate_).
1. Let _y_ be ? ToNumber(_endDate_).
1. Return ? FormatDateTimeRangeToParts(_dtf_, _x_, _y_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.DateTimeFormat.prototype.formatToParts">
<h1>Intl.DateTimeFormat.prototype.formatToParts ( _date_ )</h1>

<p>
When the `formatToParts` method is called with an argument _date_, the following steps are taken:
</p>

<emu-alg>
1. Let _dtf_ be the *this* value.
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1. If _date_ is *undefined*, then
1. Let _x_ be ! Call(%Date.now%, *undefined*).
1. Else,
1. Let _x_ be ? ToNumber(_date_).
1. Return ? FormatDateTimeToParts(_dtf_, _x_).
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-properties-of-intl-datetimeformat-instances">
Expand Down
94 changes: 47 additions & 47 deletions spec/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,38 +203,6 @@ <h1>Intl.Locale.prototype [ %Symbol.toStringTag% ]</h1>
</p>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.maximize">
<h1>Intl.Locale.prototype.maximize ( )</h1>

<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Let _maximal_ be the result of the <a href="https://unicode.org/reports/tr35/#Likely_Subtags">Add Likely Subtags</a> algorithm applied to _loc_.[[Locale]]. If an error is signaled, set _maximal_ to _loc_.[[Locale]].
1. Return ! Construct(%Intl.Locale%, _maximal_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.minimize">
<h1>Intl.Locale.prototype.minimize ( )</h1>

<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Let _minimal_ be the result of the <a href="https://unicode.org/reports/tr35/#Likely_Subtags">Remove Likely Subtags</a> algorithm applied to _loc_.[[Locale]]. If an error is signaled, set _minimal_ to _loc_.[[Locale]].
1. Return ! Construct(%Intl.Locale%, _minimal_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.toString">
<h1>Intl.Locale.prototype.toString ( )</h1>

<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Return _loc_.[[Locale]].
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.baseName">
<h1>get Intl.Locale.prototype.baseName</h1>
<p>`Intl.Locale.prototype.baseName` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
Expand Down Expand Up @@ -287,14 +255,35 @@ <h1>get Intl.Locale.prototype.hourCycle</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.numeric">
<h1>get Intl.Locale.prototype.numeric</h1>
<p>This property only exists if %Intl.Locale%.[[LocaleExtensionKeys]] contains *"kn"*.</p>
<p>`Intl.Locale.prototype.numeric` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
<emu-clause id="sec-Intl.Locale.prototype.language">
<h1>get Intl.Locale.prototype.language</h1>
<p>`Intl.Locale.prototype.language` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Return _loc_.[[Numeric]].
1. Return GetLocaleLanguage(_loc_.[[Locale]]).
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.maximize">
<h1>Intl.Locale.prototype.maximize ( )</h1>

<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Let _maximal_ be the result of the <a href="https://unicode.org/reports/tr35/#Likely_Subtags">Add Likely Subtags</a> algorithm applied to _loc_.[[Locale]]. If an error is signaled, set _maximal_ to _loc_.[[Locale]].
1. Return ! Construct(%Intl.Locale%, _maximal_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.minimize">
<h1>Intl.Locale.prototype.minimize ( )</h1>

<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Let _minimal_ be the result of the <a href="https://unicode.org/reports/tr35/#Likely_Subtags">Remove Likely Subtags</a> algorithm applied to _loc_.[[Locale]]. If an error is signaled, set _minimal_ to _loc_.[[Locale]].
1. Return ! Construct(%Intl.Locale%, _minimal_).
</emu-alg>
</emu-clause>

Expand All @@ -308,13 +297,24 @@ <h1>get Intl.Locale.prototype.numberingSystem</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.language">
<h1>get Intl.Locale.prototype.language</h1>
<p>`Intl.Locale.prototype.language` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
<emu-clause id="sec-Intl.Locale.prototype.numeric">
<h1>get Intl.Locale.prototype.numeric</h1>
<p>This property only exists if %Intl.Locale%.[[LocaleExtensionKeys]] contains *"kn"*.</p>
<p>`Intl.Locale.prototype.numeric` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Return GetLocaleLanguage(_loc_.[[Locale]]).
1. Return _loc_.[[Numeric]].
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.region">
<h1>get Intl.Locale.prototype.region</h1>
<p>`Intl.Locale.prototype.region` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Return GetLocaleRegion(_loc_.[[Locale]]).
</emu-alg>
</emu-clause>

Expand All @@ -328,13 +328,13 @@ <h1>get Intl.Locale.prototype.script</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-Intl.Locale.prototype.region">
<h1>get Intl.Locale.prototype.region</h1>
<p>`Intl.Locale.prototype.region` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
<emu-clause id="sec-Intl.Locale.prototype.toString">
<h1>Intl.Locale.prototype.toString ( )</h1>

<emu-alg>
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Return GetLocaleRegion(_loc_.[[Locale]]).
1. Let _loc_ be the *this* value.
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
1. Return _loc_.[[Locale]].
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down
30 changes: 15 additions & 15 deletions spec/numberformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -480,21 +480,6 @@ <h1>get Intl.NumberFormat.prototype.format</h1>
</emu-note>
</emu-clause>

<emu-clause id="sec-intl.numberformat.prototype.formattoparts">
<h1>Intl.NumberFormat.prototype.formatToParts ( _value_ )</h1>

<p>
When the `formatToParts` method is called with an optional argument _value_, the following steps are taken:
</p>

<emu-alg>
1. Let _nf_ be the *this* value.
1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]).
1. Let _x_ be ? ToIntlMathematicalValue(_value_).
1. Return FormatNumericToParts(_nf_, _x_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-intl.numberformat.prototype.formatrange">
<h1>Intl.NumberFormat.prototype.formatRange ( _start_, _end_ )</h1>

Expand Down Expand Up @@ -528,6 +513,21 @@ <h1>Intl.NumberFormat.prototype.formatRangeToParts ( _start_, _end_ )</h1>
1. Return ? FormatNumericRangeToParts(_nf_, _x_, _y_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-intl.numberformat.prototype.formattoparts">
<h1>Intl.NumberFormat.prototype.formatToParts ( _value_ )</h1>

<p>
When the `formatToParts` method is called with an optional argument _value_, the following steps are taken:
</p>

<emu-alg>
1. Let _nf_ be the *this* value.
1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]).
1. Let _x_ be ? ToIntlMathematicalValue(_value_).
1. Return FormatNumericToParts(_nf_, _x_).
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-properties-of-intl-numberformat-instances">
Expand Down

0 comments on commit 09eb2bf

Please sign in to comment.