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

LibJS: Reject '-000000' as extended year

This is a normative change in the Temporal spec.

See: e60ef9e
This commit is contained in:
Linus Groh 2022-02-02 14:36:55 +00:00
parent 8215b99df1
commit 19a2b32065
7 changed files with 60 additions and 17 deletions

View file

@ -65,6 +65,12 @@ describe("errors", () => {
);
});
test("extended year must not be negative zero", () => {
expect(() => {
Temporal.PlainTime.from("-000000-01-01T00:00:00");
}).toThrowWithMessage(RangeError, "Invalid extended year, must not be negative zero");
});
test("ambiguous string must contain a time designator", () => {
const values = [
// YYYY-MM or HHMM-UU