mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 01:56:38 +00:00
LibJS: Compare Unicode locale variants using case-insensitive matching
In the IsStructurallyValidLanguageTag AO, we of course cannot assume the variants are canonicalized to lower-case yet, because canonicalization hasn't happened yet.
This commit is contained in:
parent
fdedb3ab33
commit
940c023e09
Notes:
sideshowbarker
2024-07-18 04:53:26 +09:00
Author: https://github.com/trflynn89
Commit: 940c023e09
Pull-request: https://github.com/SerenityOS/serenity/pull/9749
Reviewed-by: https://github.com/linusg ✅
2 changed files with 8 additions and 1 deletions
|
@ -18,6 +18,13 @@ describe("errors", () => {
|
|||
});
|
||||
|
||||
test("duplicate variant subtags", () => {
|
||||
expect(() => {
|
||||
Intl.getCanonicalLocales("en-posix-POSIX");
|
||||
}).toThrowWithMessage(
|
||||
RangeError,
|
||||
"en-posix-POSIX is not a structurally valid language tag"
|
||||
);
|
||||
|
||||
expect(() => {
|
||||
Intl.getCanonicalLocales("en-POSIX-POSIX");
|
||||
}).toThrowWithMessage(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue