mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-30 03:20:28 +00:00
LibJS: Handle ZonedDateTime in ToTemporalCalendar
This commit is contained in:
parent
cfb77b66e5
commit
14e7eff43f
Notes:
sideshowbarker
2024-07-18 07:38:20 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/14e7eff43f6 Pull-request: https://github.com/SerenityOS/serenity/pull/9160 Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 4 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <LibJS/Runtime/Temporal/PlainDate.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainDateTime.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainTime.h>
|
||||
#include <LibJS/Runtime/Temporal/ZonedDateTime.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
namespace JS::Temporal {
|
||||
|
@ -300,7 +301,9 @@ Object* to_temporal_calendar(GlobalObject& global_object, Value temporal_calenda
|
|||
return &static_cast<PlainDateTime&>(temporal_calendar_like_object).calendar();
|
||||
if (is<PlainTime>(temporal_calendar_like_object))
|
||||
return &static_cast<PlainTime&>(temporal_calendar_like_object).calendar();
|
||||
// TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainYearMonth, ZonedDateTime)
|
||||
if (is<ZonedDateTime>(temporal_calendar_like_object))
|
||||
return &static_cast<ZonedDateTime&>(temporal_calendar_like_object).calendar();
|
||||
// TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainYearMonth)
|
||||
|
||||
// b. If ? HasProperty(temporalCalendarLike, "calendar") is false, return temporalCalendarLike.
|
||||
auto has_property = temporal_calendar_like_object.has_property(vm.names.calendar);
|
||||
|
|
Loading…
Reference in a new issue