LibJS: Handle PlainMonthDay in ISO{Year,Month,MonthCode,Day}

This commit is contained in:
Linus Groh 2021-08-15 00:42:31 +01:00
parent ec00d4729a
commit b76bae13fd
Notes: sideshowbarker 2024-07-18 05:42:05 +09:00

View File

@ -727,7 +727,8 @@ i32 iso_year(Object& temporal_object)
return static_cast<PlainDateTime&>(temporal_object).iso_year(); return static_cast<PlainDateTime&>(temporal_object).iso_year();
if (is<PlainYearMonth>(temporal_object)) if (is<PlainYearMonth>(temporal_object))
return static_cast<PlainYearMonth&>(temporal_object).iso_year(); return static_cast<PlainYearMonth&>(temporal_object).iso_year();
// TODO: PlainMonthDay if (is<PlainMonthDay>(temporal_object))
return static_cast<PlainMonthDay&>(temporal_object).iso_year();
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
} }
@ -744,7 +745,8 @@ u8 iso_month(Object& temporal_object)
return static_cast<PlainDateTime&>(temporal_object).iso_month(); return static_cast<PlainDateTime&>(temporal_object).iso_month();
if (is<PlainYearMonth>(temporal_object)) if (is<PlainYearMonth>(temporal_object))
return static_cast<PlainYearMonth&>(temporal_object).iso_month(); return static_cast<PlainYearMonth&>(temporal_object).iso_month();
// TODO: PlainMonthDay if (is<PlainMonthDay>(temporal_object))
return static_cast<PlainMonthDay&>(temporal_object).iso_month();
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
} }
@ -761,7 +763,8 @@ String iso_month_code(Object& temporal_object)
return build_iso_month_code(static_cast<PlainDateTime&>(temporal_object).iso_month()); return build_iso_month_code(static_cast<PlainDateTime&>(temporal_object).iso_month());
if (is<PlainYearMonth>(temporal_object)) if (is<PlainYearMonth>(temporal_object))
return build_iso_month_code(static_cast<PlainYearMonth&>(temporal_object).iso_month()); return build_iso_month_code(static_cast<PlainYearMonth&>(temporal_object).iso_month());
// TODO: PlainMonthDay if (is<PlainMonthDay>(temporal_object))
return build_iso_month_code(static_cast<PlainMonthDay&>(temporal_object).iso_month());
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
} }
@ -778,7 +781,8 @@ u8 iso_day(Object& temporal_object)
return static_cast<PlainDateTime&>(temporal_object).iso_day(); return static_cast<PlainDateTime&>(temporal_object).iso_day();
if (is<PlainYearMonth>(temporal_object)) if (is<PlainYearMonth>(temporal_object))
return static_cast<PlainYearMonth&>(temporal_object).iso_day(); return static_cast<PlainYearMonth&>(temporal_object).iso_day();
// TODO: PlainMonthDay if (is<PlainMonthDay>(temporal_object))
return static_cast<PlainMonthDay&>(temporal_object).iso_day();
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
} }