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

LibJS: Check PlainMonthDay is in the ISO date time limits in creation

This is a normative change in the Temporal spec.

See: 374305c
This commit is contained in:
Luke Wilde 2022-07-22 15:07:39 +01:00 committed by Linus Groh
parent 61847b3cef
commit 1e829c4ea8
2 changed files with 17 additions and 7 deletions

View file

@ -37,6 +37,12 @@ describe("errors", () => {
new Temporal.PlainMonthDay(1, 0);
}).toThrowWithMessage(RangeError, "Invalid plain month day");
});
test("not within iso date time limit", () => {
expect(() => {
new Temporal.PlainMonthDay(9, 30, "iso8601", 999_999_999_999_999);
}).toThrowWithMessage(RangeError, "Invalid plain month day");
});
});
describe("normal behavior", () => {