LibJS: Implement the Temporal.ZonedDateTime constructor

And the simple Temporal.ZonedDateTime.prototype getters, so that the
constructed Temporal.ZonedDateTime may actually be validated.
This commit is contained in:
Timothy Flynn 2024-11-24 20:42:47 -05:00 committed by Andreas Kling
commit 8c73cae2b8
Notes: github-actions[bot] 2024-11-26 10:04:22 +00:00
48 changed files with 1757 additions and 23 deletions

View file

@ -33,11 +33,25 @@ enum class DateType {
YearMonth,
};
enum class Disambiguation {
Compatible,
Earlier,
Later,
Reject,
};
enum class DurationOperation {
Since,
Until,
};
enum class OffsetOption {
Prefer,
Use,
Ignore,
Reject,
};
enum class Overflow {
Constrain,
Reject,
@ -144,7 +158,9 @@ double iso_date_to_epoch_days(double year, double month, double date);
double epoch_days_to_epoch_ms(double day, double time);
ThrowCompletionOr<void> check_iso_days_range(VM&, ISODate const&);
ThrowCompletionOr<Overflow> get_temporal_overflow_option(VM&, Object const& options);
ThrowCompletionOr<Disambiguation> get_temporal_disambiguation_option(VM&, Object const& options);
RoundingMode negate_rounding_mode(RoundingMode);
ThrowCompletionOr<OffsetOption> get_temporal_offset_option(VM&, Object const& options, OffsetOption fallback);
ThrowCompletionOr<ShowCalendar> get_temporal_show_calendar_name_option(VM&, Object const& options);
ThrowCompletionOr<void> validate_temporal_rounding_increment(VM&, u64 increment, u64 dividend, bool inclusive);
ThrowCompletionOr<Precision> get_temporal_fractional_second_digits_option(VM&, Object const& options);