mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibJS: Handle PlainDateTime objects in GetTemporalCalendarWithISODefault
This commit is contained in:
parent
c1005dbb0a
commit
d428787e18
Notes:
sideshowbarker
2024-07-18 08:20:29 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/d428787e18f Pull-request: https://github.com/SerenityOS/serenity/pull/9013 Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 5 additions and 4 deletions
|
@ -356,11 +356,12 @@ Object* get_temporal_calendar_with_iso_default(GlobalObject& global_object, Obje
|
|||
auto& vm = global_object.vm();
|
||||
|
||||
// 1. If item has an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], [[InitializedTemporalMonthDay]], [[InitializedTemporalTime]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then
|
||||
// TODO: The rest of the Temporal built-ins
|
||||
if (is<PlainDate>(item)) {
|
||||
// a. Return item.[[Calendar]].
|
||||
// a. Return item.[[Calendar]].
|
||||
if (is<PlainDate>(item))
|
||||
return &static_cast<PlainDate&>(item).calendar();
|
||||
}
|
||||
if (is<PlainDateTime>(item))
|
||||
return &static_cast<PlainDateTime&>(item).calendar();
|
||||
// TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainTime, PlainYearMonth, ZonedDateTime)
|
||||
|
||||
// 2. Let calendar be ? Get(item, "calendar").
|
||||
auto calendar = item.get(vm.names.calendar);
|
||||
|
|
Loading…
Reference in a new issue