LibJS: Handle Temporal.PlainDate in dynamic calendar operations

This commit is contained in:
Timothy Flynn 2024-11-23 09:29:20 -05:00 committed by Tim Flynn
parent 5be4825504
commit c83a3db542
Notes: github-actions[bot] 2024-11-24 00:38:29 +00:00
2 changed files with 6 additions and 0 deletions

View file

@ -624,6 +624,8 @@ ThrowCompletionOr<bool> is_partial_temporal_object(VM& vm, Value value)
// [[InitializedTemporalTime]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal
// slot, return false.
// FIXME: Add the other types as we define them.
if (is<PlainDate>(object))
return false;
if (is<PlainMonthDay>(object))
return false;
if (is<PlainYearMonth>(object))

View file

@ -452,6 +452,8 @@ ThrowCompletionOr<String> to_temporal_calendar_identifier(VM& vm, Value temporal
// internal slot, then
// i. Return temporalCalendarLike.[[Calendar]].
// FIXME: Add the other calendar-holding types as we define them.
if (is<PlainDate>(temporal_calendar_object))
return static_cast<PlainDate const&>(temporal_calendar_object).calendar();
if (is<PlainMonthDay>(temporal_calendar_object))
return static_cast<PlainMonthDay const&>(temporal_calendar_object).calendar();
if (is<PlainYearMonth>(temporal_calendar_object))
@ -476,6 +478,8 @@ ThrowCompletionOr<String> get_temporal_calendar_identifier_with_iso_default(VM&
// [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then
// a. Return item.[[Calendar]].
// FIXME: Add the other calendar-holding types as we define them.
if (is<PlainDate>(item))
return static_cast<PlainDate const&>(item).calendar();
if (is<PlainMonthDay>(item))
return static_cast<PlainMonthDay const&>(item).calendar();
if (is<PlainYearMonth>(item))