1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:07:45 +00:00

LibJS: Disallow calendar display names which contain an underscore

This is a normative change in the Intl spec. See:
2703d06
This commit is contained in:
Timothy Flynn 2022-03-28 08:48:18 -04:00 committed by Linus Groh
parent 7c41e6058a
commit f8e7701cf3
2 changed files with 10 additions and 2 deletions

View file

@ -27,6 +27,10 @@ describe("errors", () => {
expect(() => {
new Intl.DisplayNames("en", { type: "calendar" }).of("hello!");
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option calendar");
expect(() => {
new Intl.DisplayNames("en", { type: "calendar" }).of("abc_def");
}).toThrowWithMessage(RangeError, "abc_def is not a valid value for option calendar");
});
test("invalid dateTimeField", () => {