mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibJS: Handle PlainMonthDay in the Calendar.prototype getters
This commit is contained in:
parent
b76bae13fd
commit
0cf526d0c4
Notes:
sideshowbarker
2024-07-18 05:42:02 +09:00
Author: https://github.com/linusg
Commit: 0cf526d0c4
Pull-request: https://github.com/SerenityOS/serenity/pull/9429
Reviewed-by: https://github.com/IdanHo ✅
3 changed files with 25 additions and 8 deletions
|
@ -9,3 +9,16 @@ describe("correct behavior", () => {
|
|||
expect(calendar.month(date)).toBe(7);
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("argument must not be a Temporal.PlainMonthDay object", () => {
|
||||
const calendar = new Temporal.Calendar("iso8601");
|
||||
const plainMonthDay = new Temporal.PlainMonthDay(7, 6);
|
||||
expect(() => {
|
||||
calendar.month(plainMonthDay);
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
"Accessing month of PlainMonthDay is ambiguous, use monthCode instead"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue