mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 10:41:30 +00:00
LibJS: Implement Temporal.PlainDate.prototype.inLeapYear
This commit is contained in:
parent
c9ae7e1af1
commit
1d76be97f5
Notes:
sideshowbarker
2024-07-18 08:26:39 +09:00
Author: https://github.com/IdanHo
Commit: 1d76be97f5
Pull-request: https://github.com/SerenityOS/serenity/pull/8961
Reviewed-by: https://github.com/linusg ✅
5 changed files with 45 additions and 0 deletions
|
@ -273,6 +273,16 @@ Value calendar_months_in_year(GlobalObject& global_object, Object& calendar, Obj
|
|||
return calendar.invoke(vm.names.monthsInYear, &date_like);
|
||||
}
|
||||
|
||||
// 12.1.20 CalendarInLeapYear ( calendar, dateLike ), https://tc39.es/proposal-temporal/#sec-temporal-calendarinleapyear
|
||||
Value calendar_in_leap_year(GlobalObject& global_object, Object& calendar, Object& date_like)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
// 1. Assert: Type(calendar) is Object.
|
||||
|
||||
// 2. Return ? Invoke(calendar, "inLeapYear", « dateLike »).
|
||||
return calendar.invoke(vm.names.inLeapYear, &date_like);
|
||||
}
|
||||
|
||||
// 12.1.21 ToTemporalCalendar ( temporalCalendarLike ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalcalendar
|
||||
Object* to_temporal_calendar(GlobalObject& global_object, Value temporal_calendar_like)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue