Jelajahi Sumber

LibJS: Handle ZonedDateTime in GetTemporalCalendarWithISODefault

Linus Groh 4 tahun lalu
induk
melakukan
fa0d6d1045
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp

+ 3 - 1
Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp

@@ -369,7 +369,9 @@ Object* get_temporal_calendar_with_iso_default(GlobalObject& global_object, Obje
         return &static_cast<PlainDateTime&>(item).calendar();
     if (is<PlainTime>(item))
         return &static_cast<PlainTime&>(item).calendar();
-    // TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainYearMonth, ZonedDateTime)
+    if (is<ZonedDateTime>(item))
+        return &static_cast<ZonedDateTime&>(item).calendar();
+    // TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainYearMonth)
 
     // 2. Let calendar be ? Get(item, "calendar").
     auto calendar = item.get(vm.names.calendar);