mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
LibJS: Handle PlainDateTime objects ToTemporalCalendar
This commit is contained in:
parent
1c1354db07
commit
c1005dbb0a
1 changed files with 5 additions and 4 deletions
|
@ -292,11 +292,12 @@ Object* to_temporal_calendar(GlobalObject& global_object, Value temporal_calenda
|
||||||
if (temporal_calendar_like.is_object()) {
|
if (temporal_calendar_like.is_object()) {
|
||||||
auto& temporal_calendar_like_object = temporal_calendar_like.as_object();
|
auto& temporal_calendar_like_object = temporal_calendar_like.as_object();
|
||||||
// a. If temporalCalendarLike has an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], [[InitializedTemporalMonthDay]], [[InitializedTemporalTime]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then
|
// a. If temporalCalendarLike has an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], [[InitializedTemporalMonthDay]], [[InitializedTemporalTime]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then
|
||||||
// TODO: The rest of the Temporal built-ins
|
// i. Return temporalCalendarLike.[[Calendar]].
|
||||||
if (is<PlainDate>(temporal_calendar_like_object)) {
|
if (is<PlainDate>(temporal_calendar_like_object))
|
||||||
// i. Return temporalCalendarLike.[[Calendar]].
|
|
||||||
return &static_cast<PlainDate&>(temporal_calendar_like_object).calendar();
|
return &static_cast<PlainDate&>(temporal_calendar_like_object).calendar();
|
||||||
}
|
if (is<PlainDateTime>(temporal_calendar_like_object))
|
||||||
|
return &static_cast<PlainDateTime&>(temporal_calendar_like_object).calendar();
|
||||||
|
// TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainTime, PlainYearMonth, ZonedDateTime)
|
||||||
|
|
||||||
// b. If ? HasProperty(temporalCalendarLike, "calendar") is false, return temporalCalendarLike.
|
// b. If ? HasProperty(temporalCalendarLike, "calendar") is false, return temporalCalendarLike.
|
||||||
auto has_property = temporal_calendar_like_object.has_property(vm.names.calendar);
|
auto has_property = temporal_calendar_like_object.has_property(vm.names.calendar);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue