mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibJS: Handle PlainMonthDay in ISO{Year,Month,MonthCode,Day}
This commit is contained in:
parent
ec00d4729a
commit
b76bae13fd
Notes:
sideshowbarker
2024-07-18 05:42:05 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/b76bae13fde Pull-request: https://github.com/SerenityOS/serenity/pull/9429 Reviewed-by: https://github.com/IdanHo ✅
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user