[Intl] Impl LocaleInfo PR 63
https://github.com/tc39/proposal-intl-locale-info/pull/63 Sort collation code alphabetically before return. Bug: v8:13542 Change-Id: I1c7df69af483a96a1fc7625b11c2b850edc59283 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4094503 Commit-Queue: Frank Tang <ftang@chromium.org> Reviewed-by: Shu-yu Guo <syg@chromium.org> Cr-Commit-Position: refs/heads/main@{#84857}
This commit is contained in:
parent
f0dfa877b2
commit
6bf3344f5d
@ -531,7 +531,7 @@ MaybeHandle<JSArray> JSLocale::Collations(Isolate* isolate,
|
|||||||
icu::Locale icu_locale(*(locale->icu_locale().raw()));
|
icu::Locale icu_locale(*(locale->icu_locale().raw()));
|
||||||
return GetKeywordValuesFromLocale<icu::Collator>(
|
return GetKeywordValuesFromLocale<icu::Collator>(
|
||||||
isolate, "collations", "co", icu_locale, Intl::RemoveCollation, true,
|
isolate, "collations", "co", icu_locale, Intl::RemoveCollation, true,
|
||||||
false);
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
MaybeHandle<JSArray> JSLocale::HourCycles(Isolate* isolate,
|
MaybeHandle<JSArray> JSLocale::HourCycles(Isolate* isolate,
|
||||||
|
@ -292,3 +292,17 @@ function assertLanguageTag(child, parent) {
|
|||||||
fail(child, parent, 'language tag comparison');
|
fail(child, parent, 'language tag comparison');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function assertArrayEquals(expected, found, name_opt) {
|
||||||
|
var start = "";
|
||||||
|
if (name_opt) {
|
||||||
|
start = name_opt + " - ";
|
||||||
|
}
|
||||||
|
assertEquals(expected.length, found.length, start + "array length");
|
||||||
|
if (expected.length === found.length) {
|
||||||
|
for (var i = 0; i < expected.length; ++i) {
|
||||||
|
assertEquals(expected[i], found[i],
|
||||||
|
start + "array element at index " + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -15,5 +15,6 @@ for (var i = 0; i < a_to_z.length; i++) {
|
|||||||
locale + ".collations [" + locale.collations +
|
locale + ".collations [" + locale.collations +
|
||||||
"] does not meet 'type: alphanum{3,8}(sep alphanum{3,8})*'");
|
"] does not meet 'type: alphanum{3,8}(sep alphanum{3,8})*'");
|
||||||
});
|
});
|
||||||
|
assertArrayEquals(locale.collations, locale.collations.sort());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user