mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:37:34 +00:00
LibJS: Don't accept UTC designators in strings for plain Temporal types
This is a normative change in the Temporal spec.
See: cd2dc7d
This commit is contained in:
parent
836ce8ee5d
commit
78724fdd33
6 changed files with 87 additions and 16 deletions
|
@ -42,7 +42,7 @@ describe("correct behavior", () => {
|
|||
});
|
||||
|
||||
test("from date time string", () => {
|
||||
const plainMonthDay = Temporal.PlainMonthDay.from("2021-07-06T23:42:01Z");
|
||||
const plainMonthDay = Temporal.PlainMonthDay.from("2021-07-06T23:42:01");
|
||||
expect(plainMonthDay.monthCode).toBe("M07");
|
||||
expect(plainMonthDay.day).toBe(6);
|
||||
});
|
||||
|
@ -66,4 +66,13 @@ describe("errors", () => {
|
|||
Temporal.PlainMonthDay.from("foo");
|
||||
}).toThrowWithMessage(RangeError, "Invalid month day string 'foo'");
|
||||
});
|
||||
|
||||
test("string must not contain a UTC designator", () => {
|
||||
expect(() => {
|
||||
Temporal.PlainMonthDay.from("2021-07-06T23:42:01Z");
|
||||
}).toThrowWithMessage(
|
||||
RangeError,
|
||||
"Invalid month day string '2021-07-06T23:42:01Z': must not contain a UTC designator"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue