summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-07-25 19:42:14 +0100
committerLinus Groh <mail@linusgroh.de>2021-07-25 23:44:36 +0100
commitd428787e18f4621871adb90c22358c675349eda8 (patch)
tree8c938afb4ecf5833e7be15b7d7416f986859bb27 /Userland
parentc1005dbb0a6faf9bc71f10bea593c14ce0b1558c (diff)
downloadserenity-d428787e18f4621871adb90c22358c675349eda8.zip
LibJS: Handle PlainDateTime objects in GetTemporalCalendarWithISODefault
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp
index 33c1b009e0..7b5ae40ab3 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp
@@ -356,11 +356,12 @@ Object* get_temporal_calendar_with_iso_default(GlobalObject& global_object, Obje
auto& vm = global_object.vm();
// 1. If item has an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], [[InitializedTemporalMonthDay]], [[InitializedTemporalTime]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then
- // TODO: The rest of the Temporal built-ins
- if (is<PlainDate>(item)) {
- // a. Return item.[[Calendar]].
+ // a. Return item.[[Calendar]].
+ if (is<PlainDate>(item))
return &static_cast<PlainDate&>(item).calendar();
- }
+ if (is<PlainDateTime>(item))
+ return &static_cast<PlainDateTime&>(item).calendar();
+ // TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainTime, PlainYearMonth, ZonedDateTime)
// 2. Let calendar be ? Get(item, "calendar").
auto calendar = item.get(vm.names.calendar);