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

LibJS: Remove duplicated error message from ErrorTypes.h

ErrorType::IntlInvalidCode has almost exactly the same message as
ErrorType::OptionIsNotValidValue. Remove it, as all uses of the former
are semantically interchangeable with the latter.
This commit is contained in:
Timothy Flynn 2021-09-01 18:25:25 -04:00 committed by Linus Groh
parent 21c4922ac0
commit fdedb3ab33
3 changed files with 8 additions and 9 deletions

View file

@ -2,25 +2,25 @@ describe("errors", () => {
test("invalid language", () => {
expect(() => {
new Intl.DisplayNames("en", { type: "language" }).of("hello!");
}).toThrowWithMessage(RangeError, "'hello!' is not a valid value for option type language");
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option language");
});
test("invalid region", () => {
expect(() => {
new Intl.DisplayNames("en", { type: "region" }).of("hello!");
}).toThrowWithMessage(RangeError, "'hello!' is not a valid value for option type region");
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option region");
});
test("invalid script", () => {
expect(() => {
new Intl.DisplayNames("en", { type: "script" }).of("hello!");
}).toThrowWithMessage(RangeError, "'hello!' is not a valid value for option type script");
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option script");
});
test("invalid currency", () => {
expect(() => {
new Intl.DisplayNames("en", { type: "currency" }).of("hello!");
}).toThrowWithMessage(RangeError, "'hello!' is not a valid value for option type currency");
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option currency");
});
});