Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Arrange contents consistently #923

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
144 changes: 72 additions & 72 deletions spec/collator.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,78 @@ <h1>Intl.Collator.prototype.constructor</h1>
</p>
</emu-clause>

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

<p>
This function provides access to the locale and options computed during initialization of the object.
</p>

<emu-alg>
1. Let _collator_ be the *this* value.
1. Perform ? RequireInternalSlot(_collator_, [[InitializedCollator]]).
1. Let _options_ be OrdinaryObjectCreate(%Object.prototype%).
1. For each row of <emu-xref href="#table-collator-resolvedoptions-properties"></emu-xref>, except the header row, in table order, do
1. Let _p_ be the Property value of the current row.
1. Let _v_ be the value of _collator_'s internal slot whose name is the Internal Slot value of the current row.
1. If the current row has an Extension Key value, then
1. Let _extensionKey_ be the Extension Key value of the current row.
1. If %Intl.Collator%.[[RelevantExtensionKeys]] does not contain _extensionKey_, then
1. Set _v_ to *undefined*.
1. If _v_ is not *undefined*, then
1. Perform ! CreateDataPropertyOrThrow(_options_, _p_, _v_).
1. Return _options_.
</emu-alg>

<emu-table id="table-collator-resolvedoptions-properties">
<emu-caption>Resolved Options of Collator Instances</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Internal Slot</th>
<th>Property</th>
<th>Extension Key</th>
</tr>
</thead>
<tr>
<td>[[Locale]]</td>
<td>*"locale"*</td>
<td></td>
</tr>
<tr>
<td>[[Usage]]</td>
<td>*"usage"*</td>
<td></td>
</tr>
<tr>
<td>[[Sensitivity]]</td>
<td>*"sensitivity"*</td>
<td></td>
</tr>
<tr>
<td>[[IgnorePunctuation]]</td>
<td>*"ignorePunctuation"*</td>
<td></td>
</tr>
<tr>
<td>[[Collation]]</td>
<td>*"collation"*</td>
<td></td>
</tr>
<tr>
<td>[[Numeric]]</td>
<td>*"numeric"*</td>
<td>*"kn"*</td>
</tr>
<tr>
<td>[[CaseFirst]]</td>
<td>*"caseFirst"*</td>
<td>*"kf"*</td>
</tr>
</table>
</emu-table>
</emu-clause>

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

Expand Down Expand Up @@ -283,78 +355,6 @@ <h1>
</emu-note>
</emu-clause>
</emu-clause>

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

<p>
This function provides access to the locale and options computed during initialization of the object.
</p>

<emu-alg>
1. Let _collator_ be the *this* value.
1. Perform ? RequireInternalSlot(_collator_, [[InitializedCollator]]).
1. Let _options_ be OrdinaryObjectCreate(%Object.prototype%).
1. For each row of <emu-xref href="#table-collator-resolvedoptions-properties"></emu-xref>, except the header row, in table order, do
1. Let _p_ be the Property value of the current row.
1. Let _v_ be the value of _collator_'s internal slot whose name is the Internal Slot value of the current row.
1. If the current row has an Extension Key value, then
1. Let _extensionKey_ be the Extension Key value of the current row.
1. If %Intl.Collator%.[[RelevantExtensionKeys]] does not contain _extensionKey_, then
1. Set _v_ to *undefined*.
1. If _v_ is not *undefined*, then
1. Perform ! CreateDataPropertyOrThrow(_options_, _p_, _v_).
1. Return _options_.
</emu-alg>

<emu-table id="table-collator-resolvedoptions-properties">
<emu-caption>Resolved Options of Collator Instances</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Internal Slot</th>
<th>Property</th>
<th>Extension Key</th>
</tr>
</thead>
<tr>
<td>[[Locale]]</td>
<td>*"locale"*</td>
<td></td>
</tr>
<tr>
<td>[[Usage]]</td>
<td>*"usage"*</td>
<td></td>
</tr>
<tr>
<td>[[Sensitivity]]</td>
<td>*"sensitivity"*</td>
<td></td>
</tr>
<tr>
<td>[[IgnorePunctuation]]</td>
<td>*"ignorePunctuation"*</td>
<td></td>
</tr>
<tr>
<td>[[Collation]]</td>
<td>*"collation"*</td>
<td></td>
</tr>
<tr>
<td>[[Numeric]]</td>
<td>*"numeric"*</td>
<td>*"kn"*</td>
</tr>
<tr>
<td>[[CaseFirst]]</td>
<td>*"caseFirst"*</td>
<td>*"kf"*</td>
</tr>
</table>
</emu-table>
</emu-clause>
</emu-clause>

<emu-clause id="sec-properties-of-intl-collator-instances">
Expand Down
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
Loading
Loading