diff options
author | Linus Groh <mail@linusgroh.de> | 2021-08-07 23:38:04 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-08 17:45:06 +0100 |
commit | 2aec6653c4eec842b22fe628c5286377cbb0eb09 (patch) | |
tree | d83588c9e02cab049200ba6b06f53dcddfdeac34 /Userland/Libraries/LibJS | |
parent | 0a8edd5ce733b6043ce47c36aa7915354b6fd1c5 (diff) | |
download | serenity-2aec6653c4eec842b22fe628c5286377cbb0eb09.zip |
LibJS: Handle PlainYearMonth in ToTemporalCalendar
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp index cf64642c65..29950ecef6 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp @@ -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); |