mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:07:44 +00:00
LibJS: Handle existing Intl.Locale objects in CanonicalizeLocaleList
This commit is contained in:
parent
4de05faa8a
commit
27fc3cfe75
2 changed files with 22 additions and 8 deletions
|
@ -115,4 +115,12 @@ describe("normal behavior", () => {
|
|||
"en-US-u-1k-aaa-2k-ccc",
|
||||
]);
|
||||
});
|
||||
|
||||
test("canonicalize locale objects", () => {
|
||||
const en = new Intl.Locale("en", { script: "Latn" });
|
||||
expect(Intl.getCanonicalLocales(en)).toEqual(["en-Latn"]);
|
||||
|
||||
const es = new Intl.Locale("es", { region: "419" });
|
||||
expect(Intl.getCanonicalLocales([en, es])).toEqual(["en-Latn", "es-419"]);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue