Skip to content

Commit 1f315d5

Browse files
authored
Editorial: Fix incorrect validation of variants for Intl.Locale construction (#1007)
Fixes #1006
1 parent e8c995a commit 1f315d5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spec/locale.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ <h1>
8989
1. If _region_ cannot be matched by the <code>unicode_region_subtag</code> Unicode locale nonterminal, throw a *RangeError* exception.
9090
1. Let _variants_ be ? GetOption(_options_, *"variants"*, ~string~, ~empty~, GetLocaleVariants(_baseName_)).
9191
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.
92+
1. If _variants_ is the empty String, throw a *RangeError* exception.
93+
1. For each element _variant_ of StringSplitToList(_variants_, *"-"*), do
94+
1. If _variant_ cannot be matched by the <code>unicode_variant_subtag</code> Unicode locale nonterminal, throw a *RangeError* exception.
95+
1. If _variants_ contains any duplicate subtags, throw a *RangeError* exception.
9396
1. Let _allExtensions_ be the suffix of _tag_ following _baseName_.
9497
1. Let _newTag_ be _language_.
9598
1. If _script_ is not *undefined*, set _newTag_ to the string-concatenation of _newTag_, *"-"*, and _script_.

0 commit comments

Comments
 (0)