From c2d45e5a83fb35b58445251f6c08c1a14a5edf50 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 28 Jul 2021 19:11:26 +0100 Subject: LibJS: Handle PlainTime objects in ToTemporalCalendar --- Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 #include #include +#include #include namespace JS::Temporal { @@ -297,7 +298,9 @@ Object* to_temporal_calendar(GlobalObject& global_object, Value temporal_calenda return &static_cast(temporal_calendar_like_object).calendar(); if (is(temporal_calendar_like_object)) return &static_cast(temporal_calendar_like_object).calendar(); - // TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainTime, PlainYearMonth, ZonedDateTime) + if (is(temporal_calendar_like_object)) + return &static_cast(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); -- cgit v1.2.3