1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-19 08:07:39 +00:00

LibJS: Shorten some spec text for BestAvailableLocale

This is an editorial change in the Intl.NumberFormat V3 spec. See:
654bfad
This commit is contained in:
Timothy Flynn 2023-01-30 10:35:38 -05:00 committed by Tim Flynn
parent 4475f21e9e
commit be347f67dc

View file

@ -264,6 +264,7 @@ ThrowCompletionOr<Vector<String>> canonicalize_locale_list(VM& vm, Value locales
} }
// 9.2.2 BestAvailableLocale ( availableLocales, locale ), https://tc39.es/ecma402/#sec-bestavailablelocale // 9.2.2 BestAvailableLocale ( availableLocales, locale ), https://tc39.es/ecma402/#sec-bestavailablelocale
// 1.2.2 BestAvailableLocale ( availableLocales, locale ), https://tc39.es/proposal-intl-numberformat-v3/out/negotiation/proposed.html#sec-bestavailablelocale
Optional<StringView> best_available_locale(StringView locale) Optional<StringView> best_available_locale(StringView locale)
{ {
// 1. Let candidate be locale. // 1. Let candidate be locale.
@ -271,7 +272,7 @@ Optional<StringView> best_available_locale(StringView locale)
// 2. Repeat, // 2. Repeat,
while (true) { while (true) {
// a. If availableLocales contains an element equal to candidate, return candidate. // a. If availableLocales contains candidate, return candidate.
if (::Locale::is_locale_available(candidate)) if (::Locale::is_locale_available(candidate))
return candidate; return candidate;