LibJS: Define Intl.Locale's LocaleExtensionKeys more declaratively

This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/3898acf
This commit is contained in:
Timothy Flynn 2025-04-07 14:35:34 -04:00
parent edbedc25ed
commit ba56fbde62

View file

@ -29,9 +29,9 @@ public:
{
// 15.2.2 Internal slots, https://tc39.es/ecma402/#sec-intl.locale-internal-slots
// 1.3.2 Internal slots, https://tc39.es/proposal-intl-locale-info/#sec-intl.locale-internal-slots
// The value of the [[LocaleExtensionKeys]] internal slot is « "ca", "co", "fw", "hc", "kf", "kn", "nu" ».
// If %Intl.Collator%.[[RelevantExtensionKeys]] does not contain "kf", then remove "kf" from %Intl.Locale%.[[LocaleExtensionKeys]].
// If %Intl.Collator%.[[RelevantExtensionKeys]] does not contain "kn", then remove "kn" from %Intl.Locale%.[[LocaleExtensionKeys]].
// The value of the [[LocaleExtensionKeys]] internal slot is a List that must include all elements of
// « "ca", "co", "fw"sv, "hc", "nu" », must additionally include any element of « "kf", "kn" » that is also an
// element of %Intl.Collator%.[[RelevantExtensionKeys]], and must not include any other elements.
return AK::Array { "ca"sv, "co"sv, "fw"sv, "hc"sv, "kf"sv, "kn"sv, "nu"sv };
}