mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibJS: Implement the Temporal.PlainDateTime constructor
And the simple Temporal.PlainDateTime.prototype getters, so that the constructed Temporal.PlainDateTime may actually be validated.
This commit is contained in:
parent
a61cdeba24
commit
029b6ad1a8
Notes:
github-actions[bot]
2024-11-24 10:45:50 +00:00
Author: https://github.com/trflynn89
Commit: 029b6ad1a8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2544
41 changed files with 1210 additions and 13 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <LibJS/Runtime/Temporal/Duration.h>
|
||||
#include <LibJS/Runtime/Temporal/ISO8601.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainDate.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainDateTime.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainMonthDay.h>
|
||||
#include <LibJS/Runtime/Temporal/PlainYearMonth.h>
|
||||
#include <LibJS/Runtime/Temporal/TimeZone.h>
|
||||
|
@ -454,6 +455,8 @@ ThrowCompletionOr<String> to_temporal_calendar_identifier(VM& vm, Value temporal
|
|||
// 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<PlainDateTime>(temporal_calendar_object))
|
||||
return static_cast<PlainDateTime 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))
|
||||
|
@ -480,6 +483,8 @@ ThrowCompletionOr<String> get_temporal_calendar_identifier_with_iso_default(VM&
|
|||
// FIXME: Add the other calendar-holding types as we define them.
|
||||
if (is<PlainDate>(item))
|
||||
return static_cast<PlainDate const&>(item).calendar();
|
||||
if (is<PlainDateTime>(item))
|
||||
return static_cast<PlainDateTime const&>(item).calendar();
|
||||
if (is<PlainMonthDay>(item))
|
||||
return static_cast<PlainMonthDay const&>(item).calendar();
|
||||
if (is<PlainYearMonth>(item))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue