Skip to content

Commit e8c995a

Browse files
authored
Normative: Add variants to Intl.Locale surface area (#960)
1 parent a7ff535 commit e8c995a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

spec/locale.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ <h1>
8787
1. Let _region_ be ? GetOption(_options_, *"region"*, ~string~, ~empty~, GetLocaleRegion(_baseName_)).
8888
1. If _region_ is not *undefined*, then
8989
1. If _region_ cannot be matched by the <code>unicode_region_subtag</code> Unicode locale nonterminal, throw a *RangeError* exception.
90-
1. Let _variants_ be GetLocaleVariants(_baseName_).
90+
1. Let _variants_ be ? GetOption(_options_, *"variants"*, ~string~, ~empty~, GetLocaleVariants(_baseName_)).
91+
1. If _variants_ is not *undefined*, then
92+
1. If _variants_ cannot be matched by the <code>unicode_variant_subtag</code> Unicode locale nonterminal, throw a *RangeError* exception.
9193
1. Let _allExtensions_ be the suffix of _tag_ following _baseName_.
9294
1. Let _newTag_ be _language_.
9395
1. If _script_ is not *undefined*, set _newTag_ to the string-concatenation of _newTag_, *"-"*, and _script_.
@@ -310,6 +312,16 @@ <h1>Intl.Locale.prototype.toString ( )</h1>
310312
</emu-alg>
311313
</emu-clause>
312314

315+
<emu-clause id="sec-Intl.Locale.prototype.variants">
316+
<h1>get Intl.Locale.prototype.variants</h1>
317+
<p>`Intl.Locale.prototype.variants` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
318+
<emu-alg>
319+
1. Let _loc_ be the *this* value.
320+
1. Perform ? RequireInternalSlot(_loc_, [[InitializedLocale]]).
321+
1. Return GetLocaleVariants(_loc_.[[Locale]]).
322+
</emu-alg>
323+
</emu-clause>
324+
313325
<emu-clause id="sec-intl.locale.prototype-%symbol.tostringtag%" oldids="sec-Intl.Locale.prototype-@@tostringtag">
314326
<h1>Intl.Locale.prototype [ %Symbol.toStringTag% ]</h1>
315327

0 commit comments

Comments
 (0)