From c1005dbb0a6faf9bc71f10bea593c14ce0b1558c Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 25 Jul 2021 19:41:24 +0100 Subject: LibJS: Handle PlainDateTime objects ToTemporalCalendar --- Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp index 18a10e73b5..33c1b009e0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp @@ -292,11 +292,12 @@ Object* to_temporal_calendar(GlobalObject& global_object, Value temporal_calenda if (temporal_calendar_like.is_object()) { auto& temporal_calendar_like_object = temporal_calendar_like.as_object(); // a. If temporalCalendarLike has an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], [[InitializedTemporalMonthDay]], [[InitializedTemporalTime]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then - // TODO: The rest of the Temporal built-ins - if (is(temporal_calendar_like_object)) { - // i. Return temporalCalendarLike.[[Calendar]]. + // i. Return temporalCalendarLike.[[Calendar]]. + if (is(temporal_calendar_like_object)) 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) // 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