LibJS: Implement the Temporal.PlainYearMonth constructor

And the simple Temporal.PlainYearMonth.prototype getters, so that the
constructed Temporal.PlainYearMonth may actually be validated.
This commit is contained in:
Timothy Flynn 2024-11-21 11:22:32 -05:00 committed by Andreas Kling
commit b68d67693e
Notes: github-actions[bot] 2024-11-22 18:56:56 +00:00
27 changed files with 926 additions and 3 deletions

View file

@ -18,6 +18,7 @@
#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>
namespace JS::Temporal {
@ -467,6 +468,8 @@ ThrowCompletionOr<bool> is_partial_temporal_object(VM& vm, Value value)
// FIXME: Add the other types as we define them.
if (is<PlainMonthDay>(object))
return false;
if (is<PlainYearMonth>(object))
return false;
// 3. Let calendarProperty be ? Get(value, "calendar").
auto calendar_property = TRY(object.get(vm.names.calendar));