mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-02 04:20:28 +00:00
LibJS: Handle PlainYearMonth in ToTemporalCalendar
This commit is contained in:
parent
0a8edd5ce7
commit
2aec6653c4
Notes:
sideshowbarker
2024-07-18 07:13:39 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/2aec6653c4e Pull-request: https://github.com/SerenityOS/serenity/pull/9273 Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 4 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <LibJS/Runtime/Temporal/PlainDate.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainDateTime.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainTime.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainYearMonth.h>
|
||||
#include <LibJS/Runtime/Temporal/ZonedDateTime.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
|
@ -299,11 +300,13 @@ Object* to_temporal_calendar(GlobalObject& global_object, Value temporal_calenda
|
|||
return &static_cast<PlainDate&>(temporal_calendar_like_object).calendar();
|
||||
if (is<PlainDateTime>(temporal_calendar_like_object))
|
||||
return &static_cast<PlainDateTime&>(temporal_calendar_like_object).calendar();
|
||||
// TODO: PlainMonthDay
|
||||
if (is<PlainTime>(temporal_calendar_like_object))
|
||||
return &static_cast<PlainTime&>(temporal_calendar_like_object).calendar();
|
||||
if (is<PlainYearMonth>(temporal_calendar_like_object))
|
||||
return &static_cast<PlainYearMonth&>(temporal_calendar_like_object).calendar();
|
||||
if (is<ZonedDateTime>(temporal_calendar_like_object))
|
||||
return &static_cast<ZonedDateTime&>(temporal_calendar_like_object).calendar();
|
||||
// TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainYearMonth)
|
||||
|
||||
// b. If ? HasProperty(temporalCalendarLike, "calendar") is false, return temporalCalendarLike.
|
||||
auto has_property = temporal_calendar_like_object.has_property(vm.names.calendar);
|
||||
|
|
Loading…
Reference in a new issue