From 84e6833203cc18c2b0f1efbe98e937da917b8c7e Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 1 Nov 2022 09:07:45 -0400 Subject: [PATCH] LibJS: Alphabetically sort the collations returned by CollationsOfLocale This is a normative change in the Intl Locale Info proposal. See: https://github.com/tc39/proposal-intl-locale-info/commit/171d3ad Note this doesn't affect us because we don't have collation info from the CLDR; we just return ["default"] here. --- Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp index e62d37ed47..5ca295dfc5 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp @@ -102,7 +102,7 @@ Array* collations_of_locale(VM& vm, Locale const& locale_object) // 3. Assert: locale matches the unicode_locale_id production. VERIFY(::Locale::parse_unicode_locale_id(locale).has_value()); - // 4. Let list be a List of 1 or more unique canonical collation identifiers, which must be lower case String values conforming to the type sequence from UTS 35 Unicode Locale Identifier, section 3.2, sorted in descending preference of those in common use for string comparison in locale. The values "standard" and "search" must be excluded from list. + // 4. Let list be a List of 1 or more unique canonical collation identifiers, which must be lower case String values conforming to the type sequence from UTS 35 Unicode Locale Identifier, section 3.2, ordered as if an Array of the same values had been sorted, using %Array.prototype.sort% using undefined as comparefn, of those in common use for string comparison in locale. The values "standard" and "search" must be excluded from list. auto list = ::Locale::get_keywords_for_locale(locale, "co"sv); // 5. Return ! CreateArrayFromListOrRestricted( list, restricted ).