diff options
author | Linus Groh <mail@linusgroh.de> | 2021-07-28 19:11:26 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-07-28 21:57:30 +0100 |
commit | c2d45e5a83fb35b58445251f6c08c1a14a5edf50 (patch) | |
tree | 6dba4e10f221112d673b7913b461943c82a4b230 | |
parent | d3bed13f4ba7c105bc96119c8d498b2dd35a240a (diff) | |
download | serenity-c2d45e5a83fb35b58445251f6c08c1a14a5edf50.zip |
LibJS: Handle PlainTime objects in ToTemporalCalendar
-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 3b011ceced..acc161d6a9 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp @@ -12,6 +12,7 @@ #include <LibJS/Runtime/Temporal/CalendarConstructor.h> #include <LibJS/Runtime/Temporal/PlainDate.h> #include <LibJS/Runtime/Temporal/PlainDateTime.h> +#include <LibJS/Runtime/Temporal/PlainTime.h> #include <LibJS/Runtime/Value.h> namespace JS::Temporal { @@ -297,7 +298,9 @@ 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: The rest of the Temporal built-ins (PlainMonthDay, PlainTime, PlainYearMonth, ZonedDateTime) + if (is<PlainTime>(temporal_calendar_like_object)) + return &static_cast<PlainTime&>(temporal_calendar_like_object).calendar(); + // TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainYearMonth, ZonedDateTime) // b. If ? HasProperty(temporalCalendarLike, "calendar") is false, return temporalCalendarLike. auto has_property = temporal_calendar_like_object.has_property(vm.names.calendar); |