From d30653f9b0b34ece259b6665ddef293b992e4e44 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Mon, 2 Sep 2024 11:24:16 -0700 Subject: [PATCH 1/2] Editorial: Placed prototype.resolvedOptions before prototype constructor and [%Symbol.toStringTag%] for all Intl objects --- spec/collator.html | 144 ++++++++++++++--------------- spec/displaynames.html | 60 ++++++------- spec/listformat.html | 82 ++++++++--------- spec/numberformat.html | 170 +++++++++++++++++------------------ spec/pluralrules.html | 86 +++++++++--------- spec/relativetimeformat.html | 86 +++++++++--------- spec/segmenter.html | 52 +++++------ 7 files changed, 340 insertions(+), 340 deletions(-) diff --git a/spec/collator.html b/spec/collator.html index 05ce4734..139345c3 100644 --- a/spec/collator.html +++ b/spec/collator.html @@ -144,6 +144,78 @@

Intl.Collator.prototype.constructor

+ +

Intl.Collator.prototype.resolvedOptions ( )

+ +

+ This function provides access to the locale and options computed during initialization of the object. +

+ + + 1. Let _collator_ be the *this* value. + 1. Perform ? RequireInternalSlot(_collator_, [[InitializedCollator]]). + 1. Let _options_ be OrdinaryObjectCreate(%Object.prototype%). + 1. For each row of , 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_. + + + + Resolved Options of Collator Instances + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Internal SlotPropertyExtension Key
[[Locale]]*"locale"*
[[Usage]]*"usage"*
[[Sensitivity]]*"sensitivity"*
[[IgnorePunctuation]]*"ignorePunctuation"*
[[Collation]]*"collation"*
[[Numeric]]*"numeric"**"kn"*
[[CaseFirst]]*"caseFirst"**"kf"*
+
+
+

Intl.Collator.prototype [ %Symbol.toStringTag% ]

@@ -283,78 +355,6 @@

- - -

Intl.Collator.prototype.resolvedOptions ( )

- -

- This function provides access to the locale and options computed during initialization of the object. -

- - - 1. Let _collator_ be the *this* value. - 1. Perform ? RequireInternalSlot(_collator_, [[InitializedCollator]]). - 1. Let _options_ be OrdinaryObjectCreate(%Object.prototype%). - 1. For each row of , 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_. - - - - Resolved Options of Collator Instances - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Internal SlotPropertyExtension Key
[[Locale]]*"locale"*
[[Usage]]*"usage"*
[[Sensitivity]]*"sensitivity"*
[[IgnorePunctuation]]*"ignorePunctuation"*
[[Collation]]*"collation"*
[[Numeric]]*"numeric"**"kn"*
[[CaseFirst]]*"caseFirst"**"kf"*
-
-
diff --git a/spec/displaynames.html b/spec/displaynames.html index 331d3f22..530d4faa 100644 --- a/spec/displaynames.html +++ b/spec/displaynames.html @@ -132,36 +132,6 @@

Intl.DisplayNames.prototype.constructor

- -

Intl.DisplayNames.prototype [ %Symbol.toStringTag% ]

- -

- The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DisplayNames"*. -

-

- This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. -

-
- - -

Intl.DisplayNames.prototype.of ( _code_ )

- -

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

- - - 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 [[<_code_>]], return _fields_.[[<_code_>]]. - 1. If _displayNames_.[[Fallback]] is *"code"*, return _code_. - 1. Return *undefined*. - -
-

Intl.DisplayNames.prototype.resolvedOptions ( )

@@ -213,6 +183,36 @@

Intl.DisplayNames.prototype.resolvedOptions ( )

+ + +

Intl.DisplayNames.prototype [ %Symbol.toStringTag% ]

+ +

+ The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DisplayNames"*. +

+

+ This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. +

+
+ + +

Intl.DisplayNames.prototype.of ( _code_ )

+ +

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

+ + + 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 [[<_code_>]], return _fields_.[[<_code_>]]. + 1. If _displayNames_.[[Fallback]] is *"code"*, return _code_. + 1. Return *undefined*. + +
diff --git a/spec/listformat.html b/spec/listformat.html index 7093b087..969cb099 100644 --- a/spec/listformat.html +++ b/spec/listformat.html @@ -118,47 +118,6 @@

Intl.ListFormat.prototype.constructor

- -

Intl.ListFormat.prototype [ %Symbol.toStringTag% ]

- -

- The initial value of the %Symbol.toStringTag% property is the String value *"Intl.ListFormat"*. -

-

- This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. -

-
- - -

Intl.ListFormat.prototype.format ( _list_ )

- -

- When the `format` method is called with an argument _list_, the following steps are taken: -

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

Intl.ListFormat.prototype.formatToParts ( _list_ )

- -

- When the `formatToParts` method is called with an argument _list_, the following steps are taken: -

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

Intl.ListFormat.prototype.resolvedOptions ( )

@@ -202,6 +161,47 @@

Intl.ListFormat.prototype.resolvedOptions ( )

+ + +

Intl.ListFormat.prototype [ %Symbol.toStringTag% ]

+ +

+ The initial value of the %Symbol.toStringTag% property is the String value *"Intl.ListFormat"*. +

+

+ This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. +

+
+ + +

Intl.ListFormat.prototype.format ( _list_ )

+ +

+ When the `format` method is called with an argument _list_, the following steps are taken: +

+ + + 1. Let _lf_ be the *this* value. + 1. Perform ? RequireInternalSlot(_lf_, [[InitializedListFormat]]). + 1. Let _stringList_ be ? StringListFromIterable(_list_). + 1. Return FormatList(_lf_, _stringList_). + +
+ + +

Intl.ListFormat.prototype.formatToParts ( _list_ )

+ +

+ When the `formatToParts` method is called with an argument _list_, the following steps are taken: +

+ + + 1. Let _lf_ be the *this* value. + 1. Perform ? RequireInternalSlot(_lf_, [[InitializedListFormat]]). + 1. Let _stringList_ be ? StringListFromIterable(_list_). + 1. Return FormatListToParts(_lf_, _stringList_). + +
diff --git a/spec/numberformat.html b/spec/numberformat.html index 95138af8..f960071e 100644 --- a/spec/numberformat.html +++ b/spec/numberformat.html @@ -301,91 +301,6 @@

Intl.NumberFormat.prototype.constructor

- -

Intl.NumberFormat.prototype [ %Symbol.toStringTag% ]

- -

- The initial value of the %Symbol.toStringTag% property is the String value *"Intl.NumberFormat"*. -

-

- This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. -

-
- - -

get Intl.NumberFormat.prototype.format

- -

- Intl.NumberFormat.prototype.format is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps: -

- - - 1. Let _nf_ be the *this* value. - 1. If the implementation supports the normative optional constructor mode of , then - 1. Set _nf_ to ? UnwrapNumberFormat(_nf_). - 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). - 1. If _nf_.[[BoundFormat]] is *undefined*, then - 1. Let _F_ be a new built-in function object as defined in Number Format Functions (). - 1. Set _F_.[[NumberFormat]] to _nf_. - 1. Set _nf_.[[BoundFormat]] to _F_. - 1. Return _nf_.[[BoundFormat]]. - - - - The returned function is bound to _nf_ 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. - -
- - -

Intl.NumberFormat.prototype.formatToParts ( _value_ )

- -

- When the `formatToParts` method is called with an optional argument _value_, the following steps are taken: -

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

Intl.NumberFormat.prototype.formatRange ( _start_, _end_ )

- -

- When the `formatRange` method is called with arguments _start_ and _end_, the following steps are taken: -

- - - 1. Let _nf_ be the *this* value. - 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). - 1. If _start_ is *undefined* or _end_ is *undefined*, throw a *TypeError* exception. - 1. Let _x_ be ? ToIntlMathematicalValue(_start_). - 1. Let _y_ be ? ToIntlMathematicalValue(_end_). - 1. Return ? FormatNumericRange(_nf_, _x_, _y_). - -
- - -

Intl.NumberFormat.prototype.formatRangeToParts ( _start_, _end_ )

- -

- When the `formatRangeToParts` method is called with arguments _start_ and _end_, the following steps are taken: -

- - - 1. Let _nf_ be the *this* value. - 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). - 1. If _start_ is *undefined* or _end_ is *undefined*, throw a *TypeError* exception. - 1. Let _x_ be ? ToIntlMathematicalValue(_start_). - 1. Let _y_ be ? ToIntlMathematicalValue(_end_). - 1. Return ? FormatNumericRangeToParts(_nf_, _x_, _y_). - -
-

Intl.NumberFormat.prototype.resolvedOptions ( )

@@ -528,6 +443,91 @@

Intl.NumberFormat.prototype.resolvedOptions ( )

+ + +

Intl.NumberFormat.prototype [ %Symbol.toStringTag% ]

+ +

+ The initial value of the %Symbol.toStringTag% property is the String value *"Intl.NumberFormat"*. +

+

+ This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. +

+
+ + +

get Intl.NumberFormat.prototype.format

+ +

+ Intl.NumberFormat.prototype.format is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps: +

+ + + 1. Let _nf_ be the *this* value. + 1. If the implementation supports the normative optional constructor mode of , then + 1. Set _nf_ to ? UnwrapNumberFormat(_nf_). + 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). + 1. If _nf_.[[BoundFormat]] is *undefined*, then + 1. Let _F_ be a new built-in function object as defined in Number Format Functions (). + 1. Set _F_.[[NumberFormat]] to _nf_. + 1. Set _nf_.[[BoundFormat]] to _F_. + 1. Return _nf_.[[BoundFormat]]. + + + + The returned function is bound to _nf_ 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. + +
+ + +

Intl.NumberFormat.prototype.formatToParts ( _value_ )

+ +

+ When the `formatToParts` method is called with an optional argument _value_, the following steps are taken: +

+ + + 1. Let _nf_ be the *this* value. + 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). + 1. Let _x_ be ? ToIntlMathematicalValue(_value_). + 1. Return FormatNumericToParts(_nf_, _x_). + +
+ + +

Intl.NumberFormat.prototype.formatRange ( _start_, _end_ )

+ +

+ When the `formatRange` method is called with arguments _start_ and _end_, the following steps are taken: +

+ + + 1. Let _nf_ be the *this* value. + 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). + 1. If _start_ is *undefined* or _end_ is *undefined*, throw a *TypeError* exception. + 1. Let _x_ be ? ToIntlMathematicalValue(_start_). + 1. Let _y_ be ? ToIntlMathematicalValue(_end_). + 1. Return ? FormatNumericRange(_nf_, _x_, _y_). + +
+ + +

Intl.NumberFormat.prototype.formatRangeToParts ( _start_, _end_ )

+ +

+ When the `formatRangeToParts` method is called with arguments _start_ and _end_, the following steps are taken: +

+ + + 1. Let _nf_ be the *this* value. + 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). + 1. If _start_ is *undefined* or _end_ is *undefined*, throw a *TypeError* exception. + 1. Let _x_ be ? ToIntlMathematicalValue(_start_). + 1. Let _y_ be ? ToIntlMathematicalValue(_end_). + 1. Return ? FormatNumericRangeToParts(_nf_, _x_, _y_). + +
diff --git a/spec/pluralrules.html b/spec/pluralrules.html index d99ef31b..6a74d11f 100644 --- a/spec/pluralrules.html +++ b/spec/pluralrules.html @@ -105,49 +105,6 @@

Intl.PluralRules.prototype.constructor

- -

Intl.PluralRules.prototype [ %Symbol.toStringTag% ]

- -

- The initial value of the %Symbol.toStringTag% property is the String value *"Intl.PluralRules"*. -

-

- This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. -

-
- - -

Intl.PluralRules.prototype.select ( _value_ )

- -

- When the `select` method is called with an argument _value_, the following steps are taken: -

- - - 1. Let _pr_ be the *this* value. - 1. Perform ? RequireInternalSlot(_pr_, [[InitializedPluralRules]]). - 1. Let _n_ be ? ToNumber(_value_). - 1. Return ResolvePlural(_pr_, _n_).[[PluralCategory]]. - -
- - -

Intl.PluralRules.prototype.selectRange ( _start_, _end_ )

- -

- When the `selectRange` method is called with arguments _start_ and _end_, the following steps are taken: -

- - - 1. Let _pr_ be the *this* value. - 1. Perform ? RequireInternalSlot(_pr_, [[InitializedPluralRules]]). - 1. If _start_ is *undefined* or _end_ is *undefined*, throw a *TypeError* exception. - 1. Let _x_ be ? ToNumber(_start_). - 1. Let _y_ be ? ToNumber(_end_). - 1. Return ? ResolvePluralRange(_pr_, _x_, _y_). - -
-

Intl.PluralRules.prototype.resolvedOptions ( )

@@ -247,6 +204,49 @@

Intl.PluralRules.prototype.resolvedOptions ( )

+ + +

Intl.PluralRules.prototype [ %Symbol.toStringTag% ]

+ +

+ The initial value of the %Symbol.toStringTag% property is the String value *"Intl.PluralRules"*. +

+

+ This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. +

+
+ + +

Intl.PluralRules.prototype.select ( _value_ )

+ +

+ When the `select` method is called with an argument _value_, the following steps are taken: +

+ + + 1. Let _pr_ be the *this* value. + 1. Perform ? RequireInternalSlot(_pr_, [[InitializedPluralRules]]). + 1. Let _n_ be ? ToNumber(_value_). + 1. Return ResolvePlural(_pr_, _n_).[[PluralCategory]]. + +
+ + +

Intl.PluralRules.prototype.selectRange ( _start_, _end_ )

+ +

+ When the `selectRange` method is called with arguments _start_ and _end_, the following steps are taken: +

+ + + 1. Let _pr_ be the *this* value. + 1. Perform ? RequireInternalSlot(_pr_, [[InitializedPluralRules]]). + 1. If _start_ is *undefined* or _end_ is *undefined*, throw a *TypeError* exception. + 1. Let _x_ be ? ToNumber(_start_). + 1. Let _y_ be ? ToNumber(_end_). + 1. Return ? ResolvePluralRange(_pr_, _x_, _y_). + +
diff --git a/spec/relativetimeformat.html b/spec/relativetimeformat.html index b8bdbc09..d9c68dbe 100644 --- a/spec/relativetimeformat.html +++ b/spec/relativetimeformat.html @@ -129,49 +129,6 @@

Intl.RelativeTimeFormat.prototype.constructor

- -

Intl.RelativeTimeFormat.prototype [ %Symbol.toStringTag% ]

- -

- The initial value of the %Symbol.toStringTag% property is the String value *"Intl.RelativeTimeFormat"*. -

-

- This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. -

-
- - -

Intl.RelativeTimeFormat.prototype.format ( _value_, _unit_ )

- -

- When the `format` method is called with arguments _value_ and _unit_, the following steps are taken: -

- - - 1. Let _relativeTimeFormat_ be the *this* value. - 1. Perform ? RequireInternalSlot(_relativeTimeFormat_, [[InitializedRelativeTimeFormat]]). - 1. Let _value_ be ? ToNumber(_value_). - 1. Let _unit_ be ? ToString(_unit_). - 1. Return ? FormatRelativeTime(_relativeTimeFormat_, _value_, _unit_). - -
- - -

Intl.RelativeTimeFormat.prototype.formatToParts ( _value_, _unit_ )

- -

- When the `formatToParts` method is called with arguments _value_ and _unit_, the following steps are taken: -

- - - 1. Let _relativeTimeFormat_ be the *this* value. - 1. Perform ? RequireInternalSlot(_relativeTimeFormat_, [[InitializedRelativeTimeFormat]]). - 1. Let _value_ be ? ToNumber(_value_). - 1. Let _unit_ be ? ToString(_unit_). - 1. Return ? FormatRelativeTimeToParts(_relativeTimeFormat_, _value_, _unit_). - -
-

Intl.RelativeTimeFormat.prototype.resolvedOptions ( )

@@ -219,6 +176,49 @@

Intl.RelativeTimeFormat.prototype.resolvedOptions ( )

+ + +

Intl.RelativeTimeFormat.prototype [ %Symbol.toStringTag% ]

+ +

+ The initial value of the %Symbol.toStringTag% property is the String value *"Intl.RelativeTimeFormat"*. +

+

+ This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. +

+
+ + +

Intl.RelativeTimeFormat.prototype.format ( _value_, _unit_ )

+ +

+ When the `format` method is called with arguments _value_ and _unit_, the following steps are taken: +

+ + + 1. Let _relativeTimeFormat_ be the *this* value. + 1. Perform ? RequireInternalSlot(_relativeTimeFormat_, [[InitializedRelativeTimeFormat]]). + 1. Let _value_ be ? ToNumber(_value_). + 1. Let _unit_ be ? ToString(_unit_). + 1. Return ? FormatRelativeTime(_relativeTimeFormat_, _value_, _unit_). + +
+ + +

Intl.RelativeTimeFormat.prototype.formatToParts ( _value_, _unit_ )

+ +

+ When the `formatToParts` method is called with arguments _value_ and _unit_, the following steps are taken: +

+ + + 1. Let _relativeTimeFormat_ be the *this* value. + 1. Perform ? RequireInternalSlot(_relativeTimeFormat_, [[InitializedRelativeTimeFormat]]). + 1. Let _value_ be ? ToNumber(_value_). + 1. Let _unit_ be ? ToString(_unit_). + 1. Return ? FormatRelativeTimeToParts(_relativeTimeFormat_, _value_, _unit_). + +
diff --git a/spec/segmenter.html b/spec/segmenter.html index 006a7c56..92243eef 100644 --- a/spec/segmenter.html +++ b/spec/segmenter.html @@ -100,32 +100,6 @@

Intl.Segmenter.prototype.constructor

- -

Intl.Segmenter.prototype [ %Symbol.toStringTag% ]

- -

- The initial value of the %Symbol.toStringTag% property is the String value *"Intl.Segmenter"*. -

-

- This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. -

-
- - -

Intl.Segmenter.prototype.segment ( _string_ )

- -

- The `Intl.Segmenter.prototype.segment` method is called on an Intl.Segmenter instance with argument _string_ to create a Segments instance for the string using the locale and options of the Intl.Segmenter instance. The following steps are taken: -

- - - 1. Let _segmenter_ be the *this* value. - 1. Perform ? RequireInternalSlot(_segmenter_, [[InitializedSegmenter]]). - 1. Let _string_ be ? ToString(_string_). - 1. Return CreateSegmentsObject(_segmenter_, _string_). - -
-

Intl.Segmenter.prototype.resolvedOptions ( )

@@ -165,6 +139,32 @@

Intl.Segmenter.prototype.resolvedOptions ( )

+ + +

Intl.Segmenter.prototype [ %Symbol.toStringTag% ]

+ +

+ The initial value of the %Symbol.toStringTag% property is the String value *"Intl.Segmenter"*. +

+

+ This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. +

+
+ + +

Intl.Segmenter.prototype.segment ( _string_ )

+ +

+ The `Intl.Segmenter.prototype.segment` method is called on an Intl.Segmenter instance with argument _string_ to create a Segments instance for the string using the locale and options of the Intl.Segmenter instance. The following steps are taken: +

+ + + 1. Let _segmenter_ be the *this* value. + 1. Perform ? RequireInternalSlot(_segmenter_, [[InitializedSegmenter]]). + 1. Let _string_ be ? ToString(_string_). + 1. Return CreateSegmentsObject(_segmenter_, _string_). + +
From 21414080ca6b736b40cf7f4749e8654af4550a09 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Mon, 2 Sep 2024 11:55:03 -0700 Subject: [PATCH 2/2] Editorial: Alphabetize .prototype properties --- spec/datetimeformat.html | 178 +++++++++++++++++++-------------------- spec/locale.html | 94 ++++++++++----------- spec/numberformat.html | 30 +++---- 3 files changed, 151 insertions(+), 151 deletions(-) diff --git a/spec/datetimeformat.html b/spec/datetimeformat.html index 85fa757b..7f22eba1 100644 --- a/spec/datetimeformat.html +++ b/spec/datetimeformat.html @@ -894,95 +894,6 @@

Intl.DateTimeFormat.prototype.constructor

- -

Intl.DateTimeFormat.prototype [ %Symbol.toStringTag% ]

- -

- The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DateTimeFormat"*. -

- -

- This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. -

-
- - -

get Intl.DateTimeFormat.prototype.format

- -

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

- - - 1. Let _dtf_ be the *this* value. - 1. If the implementation supports the normative optional constructor mode of , 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 (). - 1. Set _F_.[[DateTimeFormat]] to _dtf_. - 1. Set _dtf_.[[BoundFormat]] to _F_. - 1. Return _dtf_.[[BoundFormat]]. - - - - 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. - -
- - -

Intl.DateTimeFormat.prototype.formatToParts ( _date_ )

- -

- When the `formatToParts` method is called with an argument _date_, the following steps are taken: -

- - - 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_). - -
- - -

Intl.DateTimeFormat.prototype.formatRange ( _startDate_, _endDate_ )

- -

- When the `formatRange` method is called with arguments _startDate_ and _endDate_, the following steps are taken: -

- - - 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_). - -
- - -

Intl.DateTimeFormat.prototype.formatRangeToParts ( _startDate_, _endDate_ )

- -

- When the `formatRangeToParts` method is called with arguments _startDate_ and _endDate_, the following steps are taken: -

- - - 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_). - -
-

Intl.DateTimeFormat.prototype.resolvedOptions ( )

@@ -1138,6 +1049,95 @@

Intl.DateTimeFormat.prototype.resolvedOptions ( )

For compatibility with versions prior to the fifth edition, the *"hour12"* property is set in addition to the *"hourCycle"* property.
+ + +

Intl.DateTimeFormat.prototype [ %Symbol.toStringTag% ]

+ +

+ The initial value of the %Symbol.toStringTag% property is the String value *"Intl.DateTimeFormat"*. +

+ +

+ This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. +

+
+ + +

get Intl.DateTimeFormat.prototype.format

+ +

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

+ + + 1. Let _dtf_ be the *this* value. + 1. If the implementation supports the normative optional constructor mode of , 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 (). + 1. Set _F_.[[DateTimeFormat]] to _dtf_. + 1. Set _dtf_.[[BoundFormat]] to _F_. + 1. Return _dtf_.[[BoundFormat]]. + + + + 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. + +
+ + +

Intl.DateTimeFormat.prototype.formatRange ( _startDate_, _endDate_ )

+ +

+ When the `formatRange` method is called with arguments _startDate_ and _endDate_, the following steps are taken: +

+ + + 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_). + +
+ + +

Intl.DateTimeFormat.prototype.formatRangeToParts ( _startDate_, _endDate_ )

+ +

+ When the `formatRangeToParts` method is called with arguments _startDate_ and _endDate_, the following steps are taken: +

+ + + 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_). + +
+ + +

Intl.DateTimeFormat.prototype.formatToParts ( _date_ )

+ +

+ When the `formatToParts` method is called with an argument _date_, the following steps are taken: +

+ + + 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_). + +
diff --git a/spec/locale.html b/spec/locale.html index cfe65621..cddeb48c 100644 --- a/spec/locale.html +++ b/spec/locale.html @@ -204,38 +204,6 @@

Intl.Locale.prototype [ %Symbol.toStringTag% ]

- -

Intl.Locale.prototype.maximize ( )

- - - 1. Let _loc_ be the *this* value. - 1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]). - 1. Let _maximal_ be the result of the Add Likely Subtags algorithm applied to _loc_.[[Locale]]. If an error is signaled, set _maximal_ to _loc_.[[Locale]]. - 1. Return ! Construct(%Intl.Locale%, _maximal_). - -
- - -

Intl.Locale.prototype.minimize ( )

- - - 1. Let _loc_ be the *this* value. - 1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]). - 1. Let _minimal_ be the result of the Remove Likely Subtags algorithm applied to _loc_.[[Locale]]. If an error is signaled, set _minimal_ to _loc_.[[Locale]]. - 1. Return ! Construct(%Intl.Locale%, _minimal_). - -
- - -

Intl.Locale.prototype.toString ( )

- - - 1. Let _loc_ be the *this* value. - 1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]). - 1. Return _loc_.[[Locale]]. - -
-

get Intl.Locale.prototype.baseName

`Intl.Locale.prototype.baseName` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

@@ -287,14 +255,35 @@

get Intl.Locale.prototype.hourCycle

- -

get Intl.Locale.prototype.numeric

-

This property only exists if %Intl.Locale%.[[LocaleExtensionKeys]] contains *"kn"*.

-

`Intl.Locale.prototype.numeric` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

+ +

get Intl.Locale.prototype.language

+

`Intl.Locale.prototype.language` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

1. Let _loc_ be the *this* value. 1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]). - 1. Return _loc_.[[Numeric]]. + 1. Return GetLocaleLanguage(_loc_.[[Locale]]). + +
+ + +

Intl.Locale.prototype.maximize ( )

+ + + 1. Let _loc_ be the *this* value. + 1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]). + 1. Let _maximal_ be the result of the Add Likely Subtags algorithm applied to _loc_.[[Locale]]. If an error is signaled, set _maximal_ to _loc_.[[Locale]]. + 1. Return ! Construct(%Intl.Locale%, _maximal_). + +
+ + +

Intl.Locale.prototype.minimize ( )

+ + + 1. Let _loc_ be the *this* value. + 1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]). + 1. Let _minimal_ be the result of the Remove Likely Subtags algorithm applied to _loc_.[[Locale]]. If an error is signaled, set _minimal_ to _loc_.[[Locale]]. + 1. Return ! Construct(%Intl.Locale%, _minimal_).
@@ -308,13 +297,24 @@

get Intl.Locale.prototype.numberingSystem

- -

get Intl.Locale.prototype.language

-

`Intl.Locale.prototype.language` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

+ +

get Intl.Locale.prototype.numeric

+

This property only exists if %Intl.Locale%.[[LocaleExtensionKeys]] contains *"kn"*.

+

`Intl.Locale.prototype.numeric` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

1. Let _loc_ be the *this* value. 1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]). - 1. Return GetLocaleLanguage(_loc_.[[Locale]]). + 1. Return _loc_.[[Numeric]]. + +
+ + +

get Intl.Locale.prototype.region

+

`Intl.Locale.prototype.region` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

+ + 1. Let _loc_ be the *this* value. + 1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]). + 1. Return GetLocaleRegion(_loc_.[[Locale]]).
@@ -328,13 +328,13 @@

get Intl.Locale.prototype.script

- -

get Intl.Locale.prototype.region

-

`Intl.Locale.prototype.region` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

+ +

Intl.Locale.prototype.toString ( )

+ - 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]].
diff --git a/spec/numberformat.html b/spec/numberformat.html index f960071e..a80bb860 100644 --- a/spec/numberformat.html +++ b/spec/numberformat.html @@ -480,21 +480,6 @@

get Intl.NumberFormat.prototype.format

- -

Intl.NumberFormat.prototype.formatToParts ( _value_ )

- -

- When the `formatToParts` method is called with an optional argument _value_, the following steps are taken: -

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

Intl.NumberFormat.prototype.formatRange ( _start_, _end_ )

@@ -528,6 +513,21 @@

Intl.NumberFormat.prototype.formatRangeToParts ( _start_, _end_ )

1. Return ? FormatNumericRangeToParts(_nf_, _x_, _y_).
+ + +

Intl.NumberFormat.prototype.formatToParts ( _value_ )

+ +

+ When the `formatToParts` method is called with an optional argument _value_, the following steps are taken: +

+ + + 1. Let _nf_ be the *this* value. + 1. Perform ? RequireInternalSlot(_nf_, [[InitializedNumberFormat]]). + 1. Let _x_ be ? ToIntlMathematicalValue(_value_). + 1. Return FormatNumericToParts(_nf_, _x_). + +