mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 00:08:55 +00:00
LibJS: Throw on conversion from TimeZone to Calendar and vice versa
This is a normative change in the Temporal spec.
See: 2084e77
This commit is contained in:
parent
ca038c1a4e
commit
b0e7d59b8b
Notes:
sideshowbarker
2024-07-17 06:45:52 +09:00
Author: https://github.com/linusg
Commit: b0e7d59b8b
Pull-request: https://github.com/SerenityOS/serenity/pull/16277
Reviewed-by: https://github.com/IdanHo ✅
5 changed files with 60 additions and 10 deletions
|
@ -43,3 +43,15 @@ describe("normal behavior", () => {
|
|||
expect(madeObservableHasPropertyLookup).toBeFalse();
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("Calendar from TimeZone", () => {
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
expect(() => {
|
||||
Temporal.Calendar.from(timeZone);
|
||||
}).toThrowWithMessage(
|
||||
RangeError,
|
||||
"Got unexpected TimeZone object in conversion to Calendar"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -64,3 +64,15 @@ describe("normal behavior", () => {
|
|||
expect(madeObservableHasPropertyLookup).toBeFalse();
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("TimeZone from Calendar", () => {
|
||||
const calendar = new Temporal.Calendar("iso8601");
|
||||
expect(() => {
|
||||
Temporal.TimeZone.from(calendar);
|
||||
}).toThrowWithMessage(
|
||||
RangeError,
|
||||
"Got unexpected Calendar object in conversion to TimeZone"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue