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

Placed prototype.resolvedOptions before prototype constructor and
[%Symbol.toStringTag%] for all Intl objects
  • Loading branch information
ben-allen committed Sep 12, 2024
1 parent ef423a8 commit 1cb5af3
Show file tree
Hide file tree
Showing 7 changed files with 340 additions and 340 deletions.
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
60 changes: 30 additions & 30 deletions spec/displaynames.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,36 +132,6 @@ <h1>Intl.DisplayNames.prototype.constructor</h1>
</p>
</emu-clause>

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

<p>
The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DisplayNames"*.
</p>
<p>
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
</p>
</emu-clause>

<emu-clause id="sec-Intl.DisplayNames.prototype.of">
<h1>Intl.DisplayNames.prototype.of ( _code_ )</h1>

<p>
When the `Intl.DisplayNames.prototype.of` is called with an argument _code_, the following steps are taken:
</p>

<emu-alg>
1. Let _displayNames_ be *this* value.
1. Perform ? RequireInternalSlot(_displayNames_, [[InitializedDisplayNames]]).
1. Let _code_ be ? ToString(_code_).
1. Set _code_ to ? CanonicalCodeForDisplayNames(_displayNames_.[[Type]], _code_).
1. Let _fields_ be _displayNames_.[[Fields]].
1. If _fields_ has a field [[&lt;_code_&gt;]], return _fields_.[[&lt;_code_&gt;]].
1. If _displayNames_.[[Fallback]] is *"code"*, return _code_.
1. Return *undefined*.
</emu-alg>
</emu-clause>

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

Expand Down Expand Up @@ -213,6 +183,36 @@ <h1>Intl.DisplayNames.prototype.resolvedOptions ( )</h1>
</table>
</emu-table>
</emu-clause>

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

<p>
The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DisplayNames"*.
</p>
<p>
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
</p>
</emu-clause>

<emu-clause id="sec-Intl.DisplayNames.prototype.of">
<h1>Intl.DisplayNames.prototype.of ( _code_ )</h1>

<p>
When the `Intl.DisplayNames.prototype.of` is called with an argument _code_, the following steps are taken:
</p>

<emu-alg>
1. Let _displayNames_ be *this* value.
1. Perform ? RequireInternalSlot(_displayNames_, [[InitializedDisplayNames]]).
1. Let _code_ be ? ToString(_code_).
1. Set _code_ to ? CanonicalCodeForDisplayNames(_displayNames_.[[Type]], _code_).
1. Let _fields_ be _displayNames_.[[Fields]].
1. If _fields_ has a field [[&lt;_code_&gt;]], return _fields_.[[&lt;_code_&gt;]].
1. If _displayNames_.[[Fallback]] is *"code"*, return _code_.
1. Return *undefined*.
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-properties-of-intl-displaynames-instances">
Expand Down
82 changes: 41 additions & 41 deletions spec/listformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,47 +118,6 @@ <h1>Intl.ListFormat.prototype.constructor</h1>
</p>
</emu-clause>

<emu-clause id="sec-Intl.ListFormat.prototype-toStringTag">
<h1>Intl.ListFormat.prototype [ %Symbol.toStringTag% ]</h1>

<p>
The initial value of the %Symbol.toStringTag% property is the String value *"Intl.ListFormat"*.
</p>
<p>
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
</p>
</emu-clause>

<emu-clause id="sec-Intl.ListFormat.prototype.format">
<h1>Intl.ListFormat.prototype.format ( _list_ )</h1>

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

<emu-alg>
1. Let _lf_ be the *this* value.
1. Perform ? RequireInternalSlot(_lf_, [[InitializedListFormat]]).
1. Let _stringList_ be ? StringListFromIterable(_list_).
1. Return FormatList(_lf_, _stringList_).
</emu-alg>
</emu-clause>

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

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

<emu-alg>
1. Let _lf_ be the *this* value.
1. Perform ? RequireInternalSlot(_lf_, [[InitializedListFormat]]).
1. Let _stringList_ be ? StringListFromIterable(_list_).
1. Return FormatListToParts(_lf_, _stringList_).
</emu-alg>
</emu-clause>

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

Expand Down Expand Up @@ -202,6 +161,47 @@ <h1>Intl.ListFormat.prototype.resolvedOptions ( )</h1>
</table>
</emu-table>
</emu-clause>

<emu-clause id="sec-Intl.ListFormat.prototype-toStringTag">
<h1>Intl.ListFormat.prototype [ %Symbol.toStringTag% ]</h1>

<p>
The initial value of the %Symbol.toStringTag% property is the String value *"Intl.ListFormat"*.
</p>
<p>
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
</p>
</emu-clause>

<emu-clause id="sec-Intl.ListFormat.prototype.format">
<h1>Intl.ListFormat.prototype.format ( _list_ )</h1>

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

<emu-alg>
1. Let _lf_ be the *this* value.
1. Perform ? RequireInternalSlot(_lf_, [[InitializedListFormat]]).
1. Let _stringList_ be ? StringListFromIterable(_list_).
1. Return FormatList(_lf_, _stringList_).
</emu-alg>
</emu-clause>

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

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

<emu-alg>
1. Let _lf_ be the *this* value.
1. Perform ? RequireInternalSlot(_lf_, [[InitializedListFormat]]).
1. Let _stringList_ be ? StringListFromIterable(_list_).
1. Return FormatListToParts(_lf_, _stringList_).
</emu-alg>
</emu-clause>
</emu-clause>

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

0 comments on commit 1cb5af3

Please sign in to comment.