Skip to content

Commit 70accc6

Browse files
committed
Normative: Update String toLocale{Lower,Upper}Case to ResolveLocale with best-fit matching
Fixes tc39#896
1 parent 239f27c commit 70accc6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spec/locale-sensitive-functions.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@ <h1>
7979
</dl>
8080
<emu-alg>
8181
1. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
82-
1. If _requestedLocales_ is not an empty List, then
83-
1. Let _requestedLocale_ be _requestedLocales_[0].
84-
1. Else,
85-
1. Let _requestedLocale_ be DefaultLocale().
8682
1. Let _availableLocales_ be an Available Locales List which includes the language tags for which the Unicode Character Database contains language-sensitive case mappings. If the implementation supports additional locale-sensitive case mappings, _availableLocales_ should also include their corresponding language tags.
87-
1. Let _match_ be LookupMatchingLocaleByPrefix(_availableLocales_, « _requestedLocale_ »).
88-
1. If _match_ is not *undefined*, let _locale_ be _match_.[[locale]]; else let _locale_ be *"und"*.
83+
1. Let _opt_ be the Record { [[localeMatcher]]: *"best fit"* }.
84+
1. Let _relevantExtensionKeys_ be a new empty List.
85+
1. Let _r_ be ResolveLocale(_availableLocales_, _requestedLocales_, _opt_, _relevantExtensionKeys_).
86+
1. Let _locale_ be _r_.[[Locale]].
8987
1. Let _codePoints_ be StringToCodePoints(_S_).
9088
1. If _targetCase_ is ~lower~, then
9189
1. Let _newCodePoints_ be a List whose elements are the result of a lowercase transformation of _codePoints_ according to an implementation-derived algorithm using _locale_ or the Unicode Default Case Conversion algorithm.

0 commit comments

Comments
 (0)