Skip to content

Commit 2141408

Browse files
committed
Editorial: Alphabetize .prototype properties
1 parent d30653f commit 2141408

File tree

3 files changed

+151
-151
lines changed

3 files changed

+151
-151
lines changed

spec/datetimeformat.html

+89-89
Original file line numberDiff line numberDiff line change
@@ -894,95 +894,6 @@ <h1>Intl.DateTimeFormat.prototype.constructor</h1>
894894
</p>
895895
</emu-clause>
896896

897-
<emu-clause id="sec-intl.datetimeformat.prototype-%symbol.tostringtag%" oldids="sec-intl.datetimeformat.prototype-@@tostringtag">
898-
<h1>Intl.DateTimeFormat.prototype [ %Symbol.toStringTag% ]</h1>
899-
900-
<p>
901-
The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DateTimeFormat"*.
902-
</p>
903-
904-
<p>
905-
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
906-
</p>
907-
</emu-clause>
908-
909-
<emu-clause id="sec-intl.datetimeformat.prototype.format">
910-
<h1>get Intl.DateTimeFormat.prototype.format</h1>
911-
912-
<p>
913-
Intl.DateTimeFormat.prototype.format is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
914-
</p>
915-
916-
<emu-alg>
917-
1. Let _dtf_ be the *this* value.
918-
1. If the implementation supports the normative optional constructor mode of <emu-xref href="#legacy-constructor"></emu-xref>, then
919-
1. Set _dtf_ to ? UnwrapDateTimeFormat(_dtf_).
920-
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
921-
1. If _dtf_.[[BoundFormat]] is *undefined*, then
922-
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>).
923-
1. Set _F_.[[DateTimeFormat]] to _dtf_.
924-
1. Set _dtf_.[[BoundFormat]] to _F_.
925-
1. Return _dtf_.[[BoundFormat]].
926-
</emu-alg>
927-
928-
<emu-note>
929-
The returned function is bound to _dtf_ so that it can be passed directly to `Array.prototype.map` or other functions.
930-
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.
931-
</emu-note>
932-
</emu-clause>
933-
934-
<emu-clause id="sec-Intl.DateTimeFormat.prototype.formatToParts">
935-
<h1>Intl.DateTimeFormat.prototype.formatToParts ( _date_ )</h1>
936-
937-
<p>
938-
When the `formatToParts` method is called with an argument _date_, the following steps are taken:
939-
</p>
940-
941-
<emu-alg>
942-
1. Let _dtf_ be the *this* value.
943-
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
944-
1. If _date_ is *undefined*, then
945-
1. Let _x_ be ! Call(%Date.now%, *undefined*).
946-
1. Else,
947-
1. Let _x_ be ? ToNumber(_date_).
948-
1. Return ? FormatDateTimeToParts(_dtf_, _x_).
949-
</emu-alg>
950-
</emu-clause>
951-
952-
<emu-clause id="sec-intl.datetimeformat.prototype.formatRange">
953-
<h1>Intl.DateTimeFormat.prototype.formatRange ( _startDate_, _endDate_ )</h1>
954-
955-
<p>
956-
When the `formatRange` method is called with arguments _startDate_ and _endDate_, the following steps are taken:
957-
</p>
958-
959-
<emu-alg>
960-
1. Let _dtf_ be *this* value.
961-
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
962-
1. If _startDate_ is *undefined* or _endDate_ is *undefined*, throw a *TypeError* exception.
963-
1. Let _x_ be ? ToNumber(_startDate_).
964-
1. Let _y_ be ? ToNumber(_endDate_).
965-
1. Return ? FormatDateTimeRange(_dtf_, _x_, _y_).
966-
</emu-alg>
967-
</emu-clause>
968-
969-
<emu-clause id="sec-Intl.DateTimeFormat.prototype.formatRangeToParts">
970-
<h1>Intl.DateTimeFormat.prototype.formatRangeToParts ( _startDate_, _endDate_ )</h1>
971-
972-
<p>
973-
When the `formatRangeToParts` method is called with arguments _startDate_ and _endDate_, the following steps are taken:
974-
</p>
975-
976-
<emu-alg>
977-
1. Let _dtf_ be *this* value.
978-
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
979-
1. If _startDate_ is *undefined* or _endDate_ is *undefined*, throw a *TypeError* exception.
980-
1. Let _x_ be ? ToNumber(_startDate_).
981-
1. Let _y_ be ? ToNumber(_endDate_).
982-
1. Return ? FormatDateTimeRangeToParts(_dtf_, _x_, _y_).
983-
</emu-alg>
984-
</emu-clause>
985-
986897
<emu-clause id="sec-intl.datetimeformat.prototype.resolvedoptions">
987898
<h1>Intl.DateTimeFormat.prototype.resolvedOptions ( )</h1>
988899

@@ -1138,6 +1049,95 @@ <h1>Intl.DateTimeFormat.prototype.resolvedOptions ( )</h1>
11381049
For compatibility with versions prior to the fifth edition, the *"hour12"* property is set in addition to the *"hourCycle"* property.
11391050
</emu-note>
11401051
</emu-clause>
1052+
1053+
<emu-clause id="sec-intl.datetimeformat.prototype-%symbol.tostringtag%" oldids="sec-intl.datetimeformat.prototype-@@tostringtag">
1054+
<h1>Intl.DateTimeFormat.prototype [ %Symbol.toStringTag% ]</h1>
1055+
1056+
<p>
1057+
The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DateTimeFormat"*.
1058+
</p>
1059+
1060+
<p>
1061+
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
1062+
</p>
1063+
</emu-clause>
1064+
1065+
<emu-clause id="sec-intl.datetimeformat.prototype.format">
1066+
<h1>get Intl.DateTimeFormat.prototype.format</h1>
1067+
1068+
<p>
1069+
Intl.DateTimeFormat.prototype.format is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
1070+
</p>
1071+
1072+
<emu-alg>
1073+
1. Let _dtf_ be the *this* value.
1074+
1. If the implementation supports the normative optional constructor mode of <emu-xref href="#legacy-constructor"></emu-xref>, then
1075+
1. Set _dtf_ to ? UnwrapDateTimeFormat(_dtf_).
1076+
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1077+
1. If _dtf_.[[BoundFormat]] is *undefined*, then
1078+
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>).
1079+
1. Set _F_.[[DateTimeFormat]] to _dtf_.
1080+
1. Set _dtf_.[[BoundFormat]] to _F_.
1081+
1. Return _dtf_.[[BoundFormat]].
1082+
</emu-alg>
1083+
1084+
<emu-note>
1085+
The returned function is bound to _dtf_ so that it can be passed directly to `Array.prototype.map` or other functions.
1086+
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.
1087+
</emu-note>
1088+
</emu-clause>
1089+
1090+
<emu-clause id="sec-intl.datetimeformat.prototype.formatRange">
1091+
<h1>Intl.DateTimeFormat.prototype.formatRange ( _startDate_, _endDate_ )</h1>
1092+
1093+
<p>
1094+
When the `formatRange` method is called with arguments _startDate_ and _endDate_, the following steps are taken:
1095+
</p>
1096+
1097+
<emu-alg>
1098+
1. Let _dtf_ be *this* value.
1099+
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1100+
1. If _startDate_ is *undefined* or _endDate_ is *undefined*, throw a *TypeError* exception.
1101+
1. Let _x_ be ? ToNumber(_startDate_).
1102+
1. Let _y_ be ? ToNumber(_endDate_).
1103+
1. Return ? FormatDateTimeRange(_dtf_, _x_, _y_).
1104+
</emu-alg>
1105+
</emu-clause>
1106+
1107+
<emu-clause id="sec-Intl.DateTimeFormat.prototype.formatRangeToParts">
1108+
<h1>Intl.DateTimeFormat.prototype.formatRangeToParts ( _startDate_, _endDate_ )</h1>
1109+
1110+
<p>
1111+
When the `formatRangeToParts` method is called with arguments _startDate_ and _endDate_, the following steps are taken:
1112+
</p>
1113+
1114+
<emu-alg>
1115+
1. Let _dtf_ be *this* value.
1116+
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1117+
1. If _startDate_ is *undefined* or _endDate_ is *undefined*, throw a *TypeError* exception.
1118+
1. Let _x_ be ? ToNumber(_startDate_).
1119+
1. Let _y_ be ? ToNumber(_endDate_).
1120+
1. Return ? FormatDateTimeRangeToParts(_dtf_, _x_, _y_).
1121+
</emu-alg>
1122+
</emu-clause>
1123+
1124+
<emu-clause id="sec-Intl.DateTimeFormat.prototype.formatToParts">
1125+
<h1>Intl.DateTimeFormat.prototype.formatToParts ( _date_ )</h1>
1126+
1127+
<p>
1128+
When the `formatToParts` method is called with an argument _date_, the following steps are taken:
1129+
</p>
1130+
1131+
<emu-alg>
1132+
1. Let _dtf_ be the *this* value.
1133+
1. Perform ? RequireInternalSlot(_dtf_, [[InitializedDateTimeFormat]]).
1134+
1. If _date_ is *undefined*, then
1135+
1. Let _x_ be ! Call(%Date.now%, *undefined*).
1136+
1. Else,
1137+
1. Let _x_ be ? ToNumber(_date_).
1138+
1. Return ? FormatDateTimeToParts(_dtf_, _x_).
1139+
</emu-alg>
1140+
</emu-clause>
11411141
</emu-clause>
11421142

11431143
<emu-clause id="sec-properties-of-intl-datetimeformat-instances">

spec/locale.html

+47-47
Original file line numberDiff line numberDiff line change
@@ -204,38 +204,6 @@ <h1>Intl.Locale.prototype [ %Symbol.toStringTag% ]</h1>
204204
</p>
205205
</emu-clause>
206206

207-
<emu-clause id="sec-Intl.Locale.prototype.maximize">
208-
<h1>Intl.Locale.prototype.maximize ( )</h1>
209-
210-
<emu-alg>
211-
1. Let _loc_ be the *this* value.
212-
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
213-
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]].
214-
1. Return ! Construct(%Intl.Locale%, _maximal_).
215-
</emu-alg>
216-
</emu-clause>
217-
218-
<emu-clause id="sec-Intl.Locale.prototype.minimize">
219-
<h1>Intl.Locale.prototype.minimize ( )</h1>
220-
221-
<emu-alg>
222-
1. Let _loc_ be the *this* value.
223-
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
224-
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]].
225-
1. Return ! Construct(%Intl.Locale%, _minimal_).
226-
</emu-alg>
227-
</emu-clause>
228-
229-
<emu-clause id="sec-Intl.Locale.prototype.toString">
230-
<h1>Intl.Locale.prototype.toString ( )</h1>
231-
232-
<emu-alg>
233-
1. Let _loc_ be the *this* value.
234-
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
235-
1. Return _loc_.[[Locale]].
236-
</emu-alg>
237-
</emu-clause>
238-
239207
<emu-clause id="sec-Intl.Locale.prototype.baseName">
240208
<h1>get Intl.Locale.prototype.baseName</h1>
241209
<p>`Intl.Locale.prototype.baseName` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
@@ -287,14 +255,35 @@ <h1>get Intl.Locale.prototype.hourCycle</h1>
287255
</emu-alg>
288256
</emu-clause>
289257

290-
<emu-clause id="sec-Intl.Locale.prototype.numeric">
291-
<h1>get Intl.Locale.prototype.numeric</h1>
292-
<p>This property only exists if %Intl.Locale%.[[LocaleExtensionKeys]] contains *"kn"*.</p>
293-
<p>`Intl.Locale.prototype.numeric` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
258+
<emu-clause id="sec-Intl.Locale.prototype.language">
259+
<h1>get Intl.Locale.prototype.language</h1>
260+
<p>`Intl.Locale.prototype.language` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
294261
<emu-alg>
295262
1. Let _loc_ be the *this* value.
296263
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
297-
1. Return _loc_.[[Numeric]].
264+
1. Return GetLocaleLanguage(_loc_.[[Locale]]).
265+
</emu-alg>
266+
</emu-clause>
267+
268+
<emu-clause id="sec-Intl.Locale.prototype.maximize">
269+
<h1>Intl.Locale.prototype.maximize ( )</h1>
270+
271+
<emu-alg>
272+
1. Let _loc_ be the *this* value.
273+
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
274+
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]].
275+
1. Return ! Construct(%Intl.Locale%, _maximal_).
276+
</emu-alg>
277+
</emu-clause>
278+
279+
<emu-clause id="sec-Intl.Locale.prototype.minimize">
280+
<h1>Intl.Locale.prototype.minimize ( )</h1>
281+
282+
<emu-alg>
283+
1. Let _loc_ be the *this* value.
284+
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
285+
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]].
286+
1. Return ! Construct(%Intl.Locale%, _minimal_).
298287
</emu-alg>
299288
</emu-clause>
300289

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

311-
<emu-clause id="sec-Intl.Locale.prototype.language">
312-
<h1>get Intl.Locale.prototype.language</h1>
313-
<p>`Intl.Locale.prototype.language` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
300+
<emu-clause id="sec-Intl.Locale.prototype.numeric">
301+
<h1>get Intl.Locale.prototype.numeric</h1>
302+
<p>This property only exists if %Intl.Locale%.[[LocaleExtensionKeys]] contains *"kn"*.</p>
303+
<p>`Intl.Locale.prototype.numeric` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
314304
<emu-alg>
315305
1. Let _loc_ be the *this* value.
316306
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
317-
1. Return GetLocaleLanguage(_loc_.[[Locale]]).
307+
1. Return _loc_.[[Numeric]].
308+
</emu-alg>
309+
</emu-clause>
310+
311+
<emu-clause id="sec-Intl.Locale.prototype.region">
312+
<h1>get Intl.Locale.prototype.region</h1>
313+
<p>`Intl.Locale.prototype.region` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
314+
<emu-alg>
315+
1. Let _loc_ be the *this* value.
316+
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
317+
1. Return GetLocaleRegion(_loc_.[[Locale]]).
318318
</emu-alg>
319319
</emu-clause>
320320

@@ -328,13 +328,13 @@ <h1>get Intl.Locale.prototype.script</h1>
328328
</emu-alg>
329329
</emu-clause>
330330

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

spec/numberformat.html

+15-15
Original file line numberDiff line numberDiff line change
@@ -480,21 +480,6 @@ <h1>get Intl.NumberFormat.prototype.format</h1>
480480
</emu-note>
481481
</emu-clause>
482482

483-
<emu-clause id="sec-intl.numberformat.prototype.formattoparts">
484-
<h1>Intl.NumberFormat.prototype.formatToParts ( _value_ )</h1>
485-
486-
<p>
487-
When the `formatToParts` method is called with an optional argument _value_, the following steps are taken:
488-
</p>
489-
490-
<emu-alg>
491-
1. Let _nf_ be the *this* value.
492-
1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]).
493-
1. Let _x_ be ? ToIntlMathematicalValue(_value_).
494-
1. Return FormatNumericToParts(_nf_, _x_).
495-
</emu-alg>
496-
</emu-clause>
497-
498483
<emu-clause id="sec-intl.numberformat.prototype.formatrange">
499484
<h1>Intl.NumberFormat.prototype.formatRange ( _start_, _end_ )</h1>
500485

@@ -528,6 +513,21 @@ <h1>Intl.NumberFormat.prototype.formatRangeToParts ( _start_, _end_ )</h1>
528513
1. Return ? FormatNumericRangeToParts(_nf_, _x_, _y_).
529514
</emu-alg>
530515
</emu-clause>
516+
517+
<emu-clause id="sec-intl.numberformat.prototype.formattoparts">
518+
<h1>Intl.NumberFormat.prototype.formatToParts ( _value_ )</h1>
519+
520+
<p>
521+
When the `formatToParts` method is called with an optional argument _value_, the following steps are taken:
522+
</p>
523+
524+
<emu-alg>
525+
1. Let _nf_ be the *this* value.
526+
1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]).
527+
1. Let _x_ be ? ToIntlMathematicalValue(_value_).
528+
1. Return FormatNumericToParts(_nf_, _x_).
529+
</emu-alg>
530+
</emu-clause>
531531
</emu-clause>
532532

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

0 commit comments

Comments
 (0)