#include "src/objects/js-temporal-objects.h"
#include <optional>
#include <set>
#include "src/common/globals.h"
#include "src/date/date.h"
#include "src/execution/isolate.h"
#include "src/heap/factory.h"
#include "src/numbers/conversions-inl.h"
#include "src/objects/js-objects-inl.h"
#include "src/objects/js-objects.h"
#include "src/objects/js-temporal-objects-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/option-utils.h"
#include "src/objects/property-descriptor.h"
#include "src/objects/string-set.h"
#include "src/strings/string-builder-inl.h"
#include "src/temporal/temporal-parser.h"
#ifdef V8_INTL_SUPPORT
#include "src/objects/intl-objects.h"
#include "src/objects/js-date-time-format.h"
#include "src/objects/managed-inl.h"
#include "unicode/calendar.h"
#include "unicode/unistr.h"
#endif
namespace v8::internal {
namespace {
enum class Unit { … };
struct UnbalancedTimeRecord { … };
DateRecord;
DateTimeRecord;
TimeRecord;
struct DateRecordWithCalendar { … };
struct TimeRecordWithCalendar { … };
struct TimeZoneRecord { … };
struct DateTimeRecordWithCalendar { … };
struct InstantRecord { … };
DurationRecord;
IsValidDuration;
TimeDurationRecord;
struct DurationRecordWithRemainder { … };
struct DateDurationRecord { … };
V8_WARN_UNUSED_RESULT Handle<String> UnitToString(Isolate* isolate, Unit unit);
enum class Disambiguation { … };
enum class ShowOverflow { … };
enum class ShowCalendar { … };
enum class ShowTimeZone { … };
Maybe<ShowTimeZone> ToShowTimeZoneNameOption(Isolate* isolate,
Handle<JSReceiver> options,
const char* method_name) { … }
enum class ShowOffset { … };
Maybe<ShowOffset> ToShowOffsetOption(Isolate* isolate,
Handle<JSReceiver> options,
const char* method_name) { … }
enum class Precision { … };
enum class Arithmetic { … };
enum class TimePreposition { … };
enum class Offset { … };
V8_WARN_UNUSED_RESULT Maybe<Offset> ToTemporalOffset(Isolate* isolate,
Handle<Object> options,
Offset fallback,
const char* method_name);
enum class RoundingMode { … };
enum class UnsignedRoundingMode { … };
enum class MatchBehaviour { … };
enum class UnitGroup { … };
struct DifferenceSettings { … };
enum class DisallowedUnitsInDifferenceSettings { … };
Maybe<DifferenceSettings> GetDifferenceSettings(
Isolate* isolate, TimePreposition operation, Handle<Object> options,
UnitGroup unit_group, DisallowedUnitsInDifferenceSettings disallowed_units,
Unit fallback_smallest_unit, Unit smallest_largest_default_unit,
const char* method_name);
V8_WARN_UNUSED_RESULT MaybeHandle<String> ParseTemporalCalendarString(
Isolate* isolate, Handle<String> iso_string);
V8_WARN_UNUSED_RESULT Maybe<DateTimeRecordWithCalendar>
ParseTemporalDateTimeString(Isolate* isolate, Handle<String> iso_string);
V8_WARN_UNUSED_RESULT Maybe<DateRecordWithCalendar> ParseTemporalDateString(
Isolate* isolate, Handle<String> iso_string);
Maybe<TimeRecordWithCalendar> ParseTemporalTimeString(
Isolate* isolate, Handle<String> iso_string);
V8_WARN_UNUSED_RESULT Maybe<DurationRecord> ParseTemporalDurationString(
Isolate* isolate, Handle<String> iso_string);
V8_WARN_UNUSED_RESULT Maybe<TimeZoneRecord> ParseTemporalTimeZoneString(
Isolate* isolate, Handle<String> iso_string);
V8_WARN_UNUSED_RESULT Maybe<int64_t> ParseTimeZoneOffsetString(
Isolate* isolate, Handle<String> offset_string);
V8_WARN_UNUSED_RESULT MaybeHandle<BigInt> ParseTemporalInstant(
Isolate* isolate, Handle<String> iso_string);
V8_WARN_UNUSED_RESULT MaybeHandle<BigInt> ParseTemporalInstant(
Isolate* isolate, Handle<String> iso_string);
DateRecord BalanceISODate(Isolate* isolate, const DateRecord& date);
V8_WARN_UNUSED_RESULT MaybeHandle<BigInt> AddInstant(
Isolate* isolate, Handle<BigInt> epoch_nanoseconds,
const TimeDurationRecord& addend);
V8_WARN_UNUSED_RESULT Maybe<TimeDurationRecord> BalanceDuration(
Isolate* isolate, Unit largest_unit, Handle<Object> relative_to,
const TimeDurationRecord& duration, const char* method_name);
V8_WARN_UNUSED_RESULT Maybe<TimeDurationRecord> BalanceDuration(
Isolate* isolate, Unit largest_unit, Handle<BigInt> nanoseconds,
const char* method_name);
V8_WARN_UNUSED_RESULT Maybe<TimeDurationRecord> BalanceDuration(
Isolate* isolate, Unit largest_unit, const TimeDurationRecord& dur1,
const TimeDurationRecord& dur2, const char* method_name);
enum BalanceOverflow { … };
struct BalancePossiblyInfiniteDurationResult { … };
V8_WARN_UNUSED_RESULT Maybe<BalancePossiblyInfiniteDurationResult>
BalancePossiblyInfiniteDuration(Isolate* isolate, Unit largest_unit,
Handle<Object> relative_to,
const TimeDurationRecord& duration,
const char* method_name);
V8_WARN_UNUSED_RESULT Maybe<BalancePossiblyInfiniteDurationResult>
BalancePossiblyInfiniteDuration(Isolate* isolate, Unit largest_unit,
Handle<Object> relative_to, double days,
Handle<BigInt> nanoseconds,
const char* method_name);
V8_WARN_UNUSED_RESULT Maybe<BalancePossiblyInfiniteDurationResult>
BalancePossiblyInfiniteDuration(Isolate* isolate, Unit largest_unit,
double days, Handle<BigInt> nanoseconds,
const char* method_name) { … }
V8_WARN_UNUSED_RESULT Maybe<DurationRecord> DifferenceISODateTime(
Isolate* isolate, const DateTimeRecord& date_time1,
const DateTimeRecord& date_time2, Handle<JSReceiver> calendar,
Unit largest_unit, Handle<JSReceiver> relative_to, const char* method_name);
V8_WARN_UNUSED_RESULT Maybe<DateTimeRecord> AddDateTime(
Isolate* isolate, const DateTimeRecord& date_time,
Handle<JSReceiver> calendar, const DurationRecord& addend,
Handle<Object> options);
V8_WARN_UNUSED_RESULT MaybeHandle<BigInt> AddZonedDateTime(
Isolate* isolate, Handle<BigInt> eopch_nanoseconds,
Handle<JSReceiver> time_zone, Handle<JSReceiver> calendar,
const DurationRecord& addend, const char* method_name);
V8_WARN_UNUSED_RESULT MaybeHandle<BigInt> AddZonedDateTime(
Isolate* isolate, Handle<BigInt> eopch_nanoseconds,
Handle<JSReceiver> time_zone, Handle<JSReceiver> calendar,
const DurationRecord& addend, Handle<Object> options,
const char* method_name);
bool IsValidEpochNanoseconds(Isolate* isolate,
DirectHandle<BigInt> epoch_nanoseconds);
struct NanosecondsToDaysResult { … };
V8_WARN_UNUSED_RESULT Maybe<NanosecondsToDaysResult> NanosecondsToDays(
Isolate* isolate, Handle<BigInt> nanoseconds,
Handle<Object> relative_to_obj, const char* method_name);
enum class OffsetBehaviour { … };
Maybe<RoundingMode> ToTemporalRoundingMode(Isolate* isolate,
Handle<JSReceiver> options,
RoundingMode fallback,
const char* method_name) { … }
V8_WARN_UNUSED_RESULT
Handle<BigInt> GetEpochFromISOParts(Isolate* isolate,
const DateTimeRecord& date_time);
int32_t ISODaysInMonth(Isolate* isolate, int32_t year, int32_t month);
int32_t ISODaysInYear(Isolate* isolate, int32_t year);
bool IsValidTime(Isolate* isolate, const TimeRecord& time);
bool IsValidISODate(Isolate* isolate, const DateRecord& date);
int32_t CompareISODate(const DateRecord& date1, const DateRecord& date2);
void BalanceISOYearMonth(Isolate* isolate, int32_t* year, int32_t* month);
V8_WARN_UNUSED_RESULT DateTimeRecord
BalanceTime(const UnbalancedTimeRecord& time);
V8_WARN_UNUSED_RESULT Maybe<TimeDurationRecord> DifferenceTime(
Isolate* isolate, const TimeRecord& time1, const TimeRecord& time2);
V8_WARN_UNUSED_RESULT DateTimeRecord AddTime(Isolate* isolate,
const TimeRecord& time,
const TimeDurationRecord& addend);
Handle<BigInt> TotalDurationNanoseconds(Isolate* isolate,
const TimeDurationRecord& duration,
double offset_shift);
Maybe<TimeRecord> ToTemporalTimeRecord(Isolate* isolate,
Handle<JSReceiver> temporal_time_like,
const char* method_name);
V8_WARN_UNUSED_RESULT MaybeHandle<JSTemporalPlainDate> CalendarDateAdd(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<Object> date,
Handle<Object> durations, Handle<Object> options, Handle<Object> date_add);
V8_WARN_UNUSED_RESULT MaybeHandle<JSTemporalPlainDate> CalendarDateAdd(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<Object> date,
Handle<Object> durations, Handle<Object> options);
V8_WARN_UNUSED_RESULT MaybeHandle<JSTemporalPlainDate> CalendarDateAdd(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<Object> date,
Handle<Object> durations);
V8_WARN_UNUSED_RESULT MaybeHandle<JSTemporalDuration> CalendarDateUntil(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<Object> one,
Handle<Object> two, Handle<Object> options, Handle<Object> date_until);
MaybeHandle<FixedArray> CalendarFields(Isolate* isolate,
Handle<JSReceiver> calendar,
DirectHandle<FixedArray> field_names);
V8_WARN_UNUSED_RESULT Maybe<int64_t> GetOffsetNanosecondsFor(
Isolate* isolate, Handle<JSReceiver> time_zone, Handle<Object> instant,
const char* method_name);
MaybeHandle<JSReceiver> ToTemporalCalendarWithISODefault(
Isolate* isolate, Handle<Object> temporal_calendar_like,
const char* method_name);
bool IsBuiltinCalendar(Isolate* isolate, Handle<String> id);
int32_t CalendarIndex(Isolate* isolate, Handle<String> id);
bool IsValidTimeZoneName(Isolate* isolate, DirectHandle<String> time_zone);
Handle<String> CanonicalizeTimeZoneName(Isolate* isolate,
DirectHandle<String> identifier);
MaybeHandle<Number> ToIntegerThrowOnInfinity(Isolate* isolate,
Handle<Object> argument);
MaybeHandle<Number> ToPositiveInteger(Isolate* isolate,
Handle<Object> argument);
inline double modulo(double a, int32_t b) { … }
#define STRINGIFY(x) …
#define TOSTRING(x) …
#define AT …
#ifdef DEBUG
#define TEMPORAL_DEBUG_INFO …
#define TEMPORAL_ENTER_FUNC() …
#else
#define TEMPORAL_DEBUG_INFO …
#define TEMPORAL_ENTER_FUNC …
#endif
#define NEW_TEMPORAL_INVALID_ARG_TYPE_ERROR() …
#define NEW_TEMPORAL_INVALID_ARG_RANGE_ERROR() …
#ifdef V8_INTL_SUPPORT
Handle<String> DefaultTimeZone(Isolate* isolate) { … }
#else
Handle<String> DefaultTimeZone(Isolate* isolate) {
TEMPORAL_ENTER_FUNC();
return isolate->factory()->UTC_string();
}
#endif
bool ISODateTimeWithinLimits(Isolate* isolate,
const DateTimeRecord& date_time) { … }
bool ISOYearMonthWithinLimits(int32_t year, int32_t month) { … }
#define ORDINARY_CREATE_FROM_CONSTRUCTOR(obj, target, new_target, T) …
#define THROW_INVALID_RANGE(T) …
#define CONSTRUCTOR(name) …
Handle<BigInt> SystemUTCEpochNanoseconds(Isolate* isolate) { … }
MaybeHandle<JSTemporalCalendar> CreateTemporalCalendar(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<String> identifier) { … }
MaybeHandle<JSTemporalCalendar> CreateTemporalCalendar(
Isolate* isolate, Handle<String> identifier) { … }
MaybeHandle<JSTemporalPlainDate> CreateTemporalDate(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
const DateRecord& date, DirectHandle<JSReceiver> calendar) { … }
MaybeHandle<JSTemporalPlainDate> CreateTemporalDate(
Isolate* isolate, const DateRecord& date,
DirectHandle<JSReceiver> calendar) { … }
MaybeHandle<JSTemporalPlainDateTime> CreateTemporalDateTime(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
const DateTimeRecord& date_time, DirectHandle<JSReceiver> calendar) { … }
MaybeHandle<JSTemporalPlainDateTime> CreateTemporalDateTimeDefaultTarget(
Isolate* isolate, const DateTimeRecord& date_time,
DirectHandle<JSReceiver> calendar) { … }
}
namespace temporal {
MaybeHandle<JSTemporalPlainDateTime> CreateTemporalDateTime(
Isolate* isolate, const DateTimeRecord& date_time,
DirectHandle<JSReceiver> calendar) { … }
}
namespace {
MaybeHandle<JSTemporalPlainTime> CreateTemporalTime(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
const TimeRecord& time) { … }
MaybeHandle<JSTemporalPlainTime> CreateTemporalTime(Isolate* isolate,
const TimeRecord& time) { … }
MaybeHandle<JSTemporalPlainMonthDay> CreateTemporalMonthDay(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
int32_t iso_month, int32_t iso_day, DirectHandle<JSReceiver> calendar,
int32_t reference_iso_year) { … }
MaybeHandle<JSTemporalPlainMonthDay> CreateTemporalMonthDay(
Isolate* isolate, int32_t iso_month, int32_t iso_day,
DirectHandle<JSReceiver> calendar, int32_t reference_iso_year) { … }
MaybeHandle<JSTemporalPlainYearMonth> CreateTemporalYearMonth(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
int32_t iso_year, int32_t iso_month, DirectHandle<JSReceiver> calendar,
int32_t reference_iso_day) { … }
MaybeHandle<JSTemporalPlainYearMonth> CreateTemporalYearMonth(
Isolate* isolate, int32_t iso_year, int32_t iso_month,
DirectHandle<JSReceiver> calendar, int32_t reference_iso_day) { … }
MaybeHandle<JSTemporalZonedDateTime> CreateTemporalZonedDateTime(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
DirectHandle<BigInt> epoch_nanoseconds, DirectHandle<JSReceiver> time_zone,
DirectHandle<JSReceiver> calendar) { … }
MaybeHandle<JSTemporalZonedDateTime> CreateTemporalZonedDateTime(
Isolate* isolate, DirectHandle<BigInt> epoch_nanoseconds,
DirectHandle<JSReceiver> time_zone, DirectHandle<JSReceiver> calendar) { … }
inline double NormalizeMinusZero(double v) { … }
Maybe<DateDurationRecord> DateDurationRecord::Create(
Isolate* isolate, double years, double months, double weeks, double days) { … }
}
namespace temporal {
Maybe<TimeDurationRecord> TimeDurationRecord::Create(
Isolate* isolate, double days, double hours, double minutes, double seconds,
double milliseconds, double microseconds, double nanoseconds) { … }
Maybe<DurationRecord> DurationRecord::Create(
Isolate* isolate, double years, double months, double weeks, double days,
double hours, double minutes, double seconds, double milliseconds,
double microseconds, double nanoseconds) { … }
}
namespace {
MaybeHandle<JSTemporalDuration> CreateTemporalDuration(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
const DurationRecord& duration) { … }
MaybeHandle<JSTemporalDuration> CreateTemporalDuration(
Isolate* isolate, const DurationRecord& duration) { … }
}
namespace temporal {
MaybeHandle<JSTemporalInstant> CreateTemporalInstant(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
DirectHandle<BigInt> epoch_nanoseconds) { … }
MaybeHandle<JSTemporalInstant> CreateTemporalInstant(
Isolate* isolate, DirectHandle<BigInt> epoch_nanoseconds) { … }
}
namespace {
MaybeHandle<JSTemporalTimeZone> CreateTemporalTimeZoneFromIndex(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
int32_t index) { … }
Handle<JSTemporalTimeZone> CreateTemporalTimeZoneUTC(
Isolate* isolate, Handle<JSFunction> target,
Handle<HeapObject> new_target) { … }
Handle<JSTemporalTimeZone> CreateTemporalTimeZoneUTC(Isolate* isolate) { … }
bool IsUTC(Isolate* isolate, Handle<String> time_zone);
MaybeHandle<JSTemporalTimeZone> CreateTemporalTimeZone(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<String> identifier) { … }
MaybeHandle<JSTemporalTimeZone> CreateTemporalTimeZoneDefaultTarget(
Isolate* isolate, Handle<String> identifier) { … }
}
namespace temporal {
MaybeHandle<JSTemporalTimeZone> CreateTemporalTimeZone(
Isolate* isolate, Handle<String> identifier) { … }
}
namespace {
Handle<JSTemporalInstant> SystemInstant(Isolate* isolate) { … }
Handle<JSTemporalTimeZone> SystemTimeZone(Isolate* isolate) { … }
DateTimeRecord GetISOPartsFromEpoch(Isolate* isolate,
Handle<BigInt> epoch_nanoseconds) { … }
DateTimeRecord BalanceISODateTime(Isolate* isolate,
const DateTimeRecord& date_time) { … }
double RoundTowardsZero(double x) { … }
Handle<String> TemporalDurationToString(Isolate* isolate,
const DurationRecord& duration,
Precision precision) { … }
void ToZeroPaddedDecimalString(IncrementalStringBuilder* builder, int32_t n,
int32_t min_length);
void FormatSecondsStringPart(IncrementalStringBuilder* builder, int32_t second,
int32_t millisecond, int32_t microsecond,
int32_t nanosecond, Precision precision) { … }
Handle<String> TemporalTimeToString(Isolate* isolate, const TimeRecord& time,
Precision precision) { … }
Handle<String> TemporalTimeToString(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Precision precision) { … }
}
namespace temporal {
MaybeHandle<JSTemporalPlainDateTime> BuiltinTimeZoneGetPlainDateTimeFor(
Isolate* isolate, Handle<JSReceiver> time_zone,
Handle<JSTemporalInstant> instant, DirectHandle<JSReceiver> calendar,
const char* method_name) { … }
}
namespace {
MaybeHandle<FixedArray> GetPossibleInstantsFor(Isolate* isolate,
Handle<JSReceiver> time_zone,
Handle<Object> date_time) { … }
MaybeHandle<JSTemporalInstant> DisambiguatePossibleInstants(
Isolate* isolate, Handle<FixedArray> possible_instants,
Handle<JSReceiver> time_zone, Handle<Object> date_time_obj,
Disambiguation disambiguation, const char* method_name) { … }
MaybeHandle<JSReceiver> GetTemporalCalendarWithISODefault(
Isolate* isolate, Handle<JSReceiver> item, const char* method_name) { … }
enum class RequiredFields { … };
V8_WARN_UNUSED_RESULT MaybeHandle<JSReceiver> PrepareTemporalFieldsOrPartial(
Isolate* isolate, Handle<JSReceiver> fields,
DirectHandle<FixedArray> field_names, RequiredFields required,
bool partial) { … }
V8_WARN_UNUSED_RESULT MaybeHandle<JSReceiver> PrepareTemporalFields(
Isolate* isolate, Handle<JSReceiver> fields,
DirectHandle<FixedArray> field_names, RequiredFields required) { … }
V8_WARN_UNUSED_RESULT MaybeHandle<JSReceiver> PreparePartialTemporalFields(
Isolate* isolate, Handle<JSReceiver> fields,
DirectHandle<FixedArray> field_names) { … }
template <typename T>
MaybeHandle<T> FromFields(Isolate* isolate, Handle<JSReceiver> calendar,
Handle<JSReceiver> fields, Handle<Object> options,
Handle<String> property, InstanceType type) { … }
MaybeHandle<JSTemporalPlainDate> DateFromFields(Isolate* isolate,
Handle<JSReceiver> calendar,
Handle<JSReceiver> fields,
Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainYearMonth> YearMonthFromFields(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<JSReceiver> fields,
Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainYearMonth> YearMonthFromFields(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<JSReceiver> fields) { … }
MaybeHandle<JSTemporalPlainMonthDay> MonthDayFromFields(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<JSReceiver> fields,
Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainMonthDay> MonthDayFromFields(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<JSReceiver> fields) { … }
Maybe<ShowOverflow> ToTemporalOverflow(Isolate* isolate, Handle<Object> options,
const char* method_name) { … }
Maybe<Offset> ToTemporalOffset(Isolate* isolate, Handle<Object> options,
Offset fallback, const char* method_name) { … }
Maybe<Disambiguation> ToTemporalDisambiguation(Isolate* isolate,
Handle<Object> options,
const char* method_name) { … }
MaybeHandle<JSTemporalInstant> BuiltinTimeZoneGetInstantFor(
Isolate* isolate, Handle<JSReceiver> time_zone,
Handle<JSTemporalPlainDateTime> date_time, Disambiguation disambiguation,
const char* method_name) { … }
MaybeHandle<JSTemporalInstant> ToTemporalInstant(Isolate* isolate,
Handle<Object> item,
const char* method_name) { … }
}
namespace temporal {
MaybeHandle<JSReceiver> ToTemporalCalendar(
Isolate* isolate, Handle<Object> temporal_calendar_like,
const char* method_name) { … }
}
namespace {
MaybeHandle<JSReceiver> ToTemporalCalendarWithISODefault(
Isolate* isolate, Handle<Object> temporal_calendar_like,
const char* method_name) { … }
Handle<FixedArray> All10UnitsInFixedArray(Isolate* isolate) { … }
Handle<FixedArray> DayMonthMonthCodeYearInFixedArray(Isolate* isolate) { … }
Handle<FixedArray> MonthMonthCodeYearInFixedArray(Isolate* isolate) { … }
Handle<FixedArray> MonthCodeYearInFixedArray(Isolate* isolate) { … }
MaybeHandle<JSTemporalPlainDate> ToTemporalDate(Isolate* isolate,
Handle<Object> item_obj,
Handle<Object> options,
const char* method_name) { … }
MaybeHandle<JSTemporalPlainDate> ToTemporalDate(Isolate* isolate,
Handle<Object> item_obj,
const char* method_name) { … }
bool IsIntegralNumber(Isolate* isolate, DirectHandle<Object> argument) { … }
Maybe<double> ToIntegerWithoutRounding(Isolate* isolate,
Handle<Object> argument) { … }
}
namespace temporal {
Maybe<TimeRecord> RegulateTime(Isolate* isolate, const TimeRecord& time,
ShowOverflow overflow) { … }
MaybeHandle<JSTemporalPlainTime> ToTemporalTime(
Isolate* isolate, Handle<Object> item_obj, const char* method_name,
ShowOverflow overflow = ShowOverflow::kConstrain) { … }
Maybe<bool> IterateDurationRecordFieldsTable(
Isolate* isolate, Handle<JSReceiver> temporal_duration_like,
Maybe<bool> (*RowFunction)(Isolate*,
Handle<JSReceiver> temporal_duration_like,
Handle<String>, double*),
DurationRecord* record) { … }
Maybe<DurationRecord> ToTemporalDurationRecord(
Isolate* isolate, Handle<Object> temporal_duration_like_obj,
const char* method_name) { … }
MaybeHandle<JSTemporalDuration> ToTemporalDuration(Isolate* isolate,
Handle<Object> item,
const char* method_name) { … }
MaybeHandle<JSReceiver> ToTemporalTimeZone(
Isolate* isolate, Handle<Object> temporal_time_zone_like,
const char* method_name) { … }
}
namespace {
MaybeHandle<JSTemporalPlainDateTime> SystemDateTime(
Isolate* isolate, Handle<Object> temporal_time_zone_like,
Handle<Object> calendar_like, const char* method_name) { … }
MaybeHandle<JSTemporalZonedDateTime> SystemZonedDateTime(
Isolate* isolate, Handle<Object> temporal_time_zone_like,
Handle<Object> calendar_like, const char* method_name) { … }
int CompareResultToSign(ComparisonResult r) { … }
Handle<String> FormatTimeZoneOffsetString(Isolate* isolate,
int64_t offset_nanoseconds) { … }
double RoundNumberToIncrement(Isolate* isolate, double x, double increment,
RoundingMode rounding_mode);
Handle<String> FormatISOTimeZoneOffsetString(Isolate* isolate,
int64_t offset_nanoseconds) { … }
int32_t DecimalLength(int32_t n) { … }
void ToZeroPaddedDecimalString(IncrementalStringBuilder* builder, int32_t n,
int32_t min_length) { … }
void PadISOYear(IncrementalStringBuilder* builder, int32_t y) { … }
Handle<String> FormatCalendarAnnotation(Isolate* isolate, Handle<String> id,
ShowCalendar show_calendar) { … }
MaybeHandle<String> MaybeFormatCalendarAnnotation(
Isolate* isolate, Handle<JSReceiver> calendar_object,
ShowCalendar show_calendar) { … }
MaybeHandle<String> TemporalDateToString(
Isolate* isolate, DirectHandle<JSTemporalPlainDate> temporal_date,
ShowCalendar show_calendar) { … }
MaybeHandle<String> TemporalMonthDayToString(
Isolate* isolate, DirectHandle<JSTemporalPlainMonthDay> month_day,
ShowCalendar show_calendar) { … }
MaybeHandle<String> TemporalYearMonthToString(
Isolate* isolate, DirectHandle<JSTemporalPlainYearMonth> year_month,
ShowCalendar show_calendar) { … }
MaybeHandle<String> BuiltinTimeZoneGetOffsetStringFor(
Isolate* isolate, Handle<JSReceiver> time_zone,
Handle<JSTemporalInstant> instant, const char* method_name) { … }
Maybe<DateTimeRecordWithCalendar> ParseISODateTime(
Isolate* isolate, Handle<String> iso_string,
const ParsedISO8601Result& parsed);
Maybe<DateTimeRecordWithCalendar> ParseISODateTime(Isolate* isolate,
Handle<String> iso_string) { … }
Maybe<DateTimeRecordWithCalendar> ParseISODateTime(
Isolate* isolate, Handle<String> iso_string,
const ParsedISO8601Result& parsed) { … }
Maybe<DateRecordWithCalendar> ParseTemporalDateString(
Isolate* isolate, Handle<String> iso_string) { … }
Maybe<TimeRecordWithCalendar> ParseTemporalTimeString(
Isolate* isolate, Handle<String> iso_string) { … }
Maybe<InstantRecord> ParseTemporalInstantString(Isolate* isolate,
Handle<String> iso_string) { … }
Maybe<DateTimeRecordWithCalendar> ParseTemporalRelativeToString(
Isolate* isolate, Handle<String> iso_string) { … }
MaybeHandle<BigInt> ParseTemporalInstant(Isolate* isolate,
Handle<String> iso_string) { … }
Maybe<DateTimeRecordWithCalendar> ParseTemporalZonedDateTimeString(
Isolate* isolate, Handle<String> iso_string) { … }
Maybe<DurationRecord> CreateDurationRecord(Isolate* isolate,
const DurationRecord& duration) { … }
inline double IfEmptyReturnZero(double value) { … }
Maybe<DurationRecord> ParseTemporalDurationString(Isolate* isolate,
Handle<String> iso_string) { … }
Maybe<TimeZoneRecord> ParseTemporalTimeZoneString(
Isolate* isolate, Handle<String> time_zone_string) { … }
Maybe<int64_t> ParseTimeZoneOffsetString(Isolate* isolate,
Handle<String> iso_string) { … }
bool IsValidTimeZoneNumericUTCOffsetString(Isolate* isolate,
Handle<String> iso_string) { … }
MaybeHandle<String> ParseTemporalCalendarString(Isolate* isolate,
Handle<String> iso_string) { … }
Maybe<bool> CalendarEqualsBool(Isolate* isolate, Handle<JSReceiver> one,
Handle<JSReceiver> two) { … }
MaybeHandle<Oddball> CalendarEquals(Isolate* isolate, Handle<JSReceiver> one,
Handle<JSReceiver> two) { … }
MaybeHandle<FixedArray> CalendarFields(Isolate* isolate,
Handle<JSReceiver> calendar,
DirectHandle<FixedArray> field_names) { … }
MaybeHandle<JSTemporalPlainDate> CalendarDateAdd(Isolate* isolate,
Handle<JSReceiver> calendar,
Handle<Object> date,
Handle<Object> duration) { … }
MaybeHandle<JSTemporalPlainDate> CalendarDateAdd(Isolate* isolate,
Handle<JSReceiver> calendar,
Handle<Object> date,
Handle<Object> duration,
Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainDate> CalendarDateAdd(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<Object> date,
Handle<Object> duration, Handle<Object> options, Handle<Object> date_add) { … }
MaybeHandle<JSTemporalDuration> CalendarDateUntil(Isolate* isolate,
Handle<JSReceiver> calendar,
Handle<Object> one,
Handle<Object> two,
Handle<Object> options) { … }
MaybeHandle<JSTemporalDuration> CalendarDateUntil(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<Object> one,
Handle<Object> two, Handle<Object> options, Handle<Object> date_until) { … }
MaybeHandle<JSReceiver> DefaultMergeFields(
Isolate* isolate, Handle<JSReceiver> fields,
Handle<JSReceiver> additional_fields) { … }
Maybe<int64_t> GetOffsetNanosecondsFor(Isolate* isolate,
Handle<JSReceiver> time_zone_obj,
Handle<Object> instant,
const char* method_name) { … }
MaybeHandle<Number> ToPositiveInteger(Isolate* isolate,
Handle<Object> argument) { … }
}
namespace temporal {
MaybeHandle<Object> InvokeCalendarMethod(Isolate* isolate,
Handle<JSReceiver> calendar,
Handle<String> name,
Handle<JSReceiver> date_like) { … }
#define CALENDAR_ABSTRACT_OPERATION_INT_ACTION(Name, name, Action) …
#define CALENDAR_ABSTRACT_OPERATION(Name, property) …
CALENDAR_ABSTRACT_OPERATION_INT_ACTION(…)
CALENDAR_ABSTRACT_OPERATION_INT_ACTION(…)
CALENDAR_ABSTRACT_OPERATION_INT_ACTION(…)
MaybeHandle<Object> CalendarMonthCode(Isolate* isolate,
Handle<JSReceiver> calendar,
Handle<JSReceiver> date_like) { … }
#ifdef V8_INTL_SUPPORT
MaybeHandle<Object> CalendarEraYear(Isolate* isolate,
Handle<JSReceiver> calendar,
Handle<JSReceiver> date_like) { … }
MaybeHandle<Object> CalendarEra(Isolate* isolate, Handle<JSReceiver> calendar,
Handle<JSReceiver> date_like) { … }
#endif
CALENDAR_ABSTRACT_OPERATION(…)
CALENDAR_ABSTRACT_OPERATION(…)
CALENDAR_ABSTRACT_OPERATION(…)
CALENDAR_ABSTRACT_OPERATION(…)
CALENDAR_ABSTRACT_OPERATION(…)
CALENDAR_ABSTRACT_OPERATION(…)
CALENDAR_ABSTRACT_OPERATION(…)
CALENDAR_ABSTRACT_OPERATION(…)
Handle<JSTemporalCalendar> GetISO8601Calendar(Isolate* isolate) { … }
}
namespace {
bool IsUTC(Isolate* isolate, Handle<String> time_zone) { … }
#ifdef V8_INTL_SUPPORT
class CalendarMap final { … };
DEFINE_LAZY_LEAKY_OBJECT_GETTER(…)
bool IsBuiltinCalendar(Isolate* isolate, Handle<String> id) { … }
Handle<String> CalendarIdentifier(Isolate* isolate, int32_t index) { … }
int32_t CalendarIndex(Isolate* isolate, Handle<String> id) { … }
bool IsValidTimeZoneName(Isolate* isolate, DirectHandle<String> time_zone) { … }
Handle<String> CanonicalizeTimeZoneName(Isolate* isolate,
DirectHandle<String> identifier) { … }
#else
Handle<String> CalendarIdentifier(Isolate* isolate, int32_t index) {
DCHECK_EQ(index, 0);
return isolate->factory()->iso8601_string();
}
bool IsBuiltinCalendar(Isolate* isolate, Handle<String> id) {
if (isolate->factory()->iso8601_string()->Equals(*id)) return true;
if (id->length() != 7) return false;
id = String::Flatten(isolate, id);
DisallowGarbageCollection no_gc;
const String::FlatContent& flat = id->GetFlatContent(no_gc);
return AsciiAlphaToLower(flat.Get(0)) == 'i' &&
AsciiAlphaToLower(flat.Get(1)) == 's' &&
AsciiAlphaToLower(flat.Get(2)) == 'o' && flat.Get(3) == '8' &&
flat.Get(4) == '6' && flat.Get(5) == '0' && flat.Get(6) == '1';
}
int32_t CalendarIndex(Isolate* isolate, Handle<String> id) { return 0; }
bool IsValidTimeZoneName(Isolate* isolate, Handle<String> time_zone) {
return IsUTC(isolate, time_zone);
}
Handle<String> CanonicalizeTimeZoneName(Isolate* isolate,
Handle<String> identifier) {
return isolate->factory()->UTC_string();
}
#endif
Maybe<TimeRecord> ToTemporalTimeRecordOrPartialTime(
Isolate* isolate, Handle<JSReceiver> temporal_time_like,
const TimeRecord& time, bool skip_undefined, const char* method_name) { … }
Maybe<TimeRecord> ToPartialTime(Isolate* isolate,
Handle<JSReceiver> temporal_time_like,
const TimeRecord& time,
const char* method_name) { … }
Maybe<TimeRecord> ToTemporalTimeRecord(Isolate* isolate,
Handle<JSReceiver> temporal_time_like,
const char* method_name) { … }
Maybe<Unit> GetTemporalUnit(Isolate* isolate,
Handle<JSReceiver> normalized_options,
const char* key, UnitGroup unit_group,
Unit default_value, bool default_is_required,
const char* method_name,
Unit extra_values = Unit::kNotPresent) { … }
MaybeHandle<JSReceiver> MergeLargestUnitOption(Isolate* isolate,
Handle<JSReceiver> options,
Unit largest_unit) { … }
MaybeHandle<Number> ToIntegerThrowOnInfinity(Isolate* isolate,
Handle<Object> argument) { … }
Unit LargerOfTwoTemporalUnits(Unit u1, Unit u2) { … }
Handle<String> UnitToString(Isolate* isolate, Unit unit) { … }
DateRecord CreateISODateRecord(Isolate* isolate, const DateRecord& date) { … }
DateRecord BalanceISODate(Isolate* isolate, const DateRecord& date) { … }
Maybe<DateTimeRecord> AddDateTime(Isolate* isolate,
const DateTimeRecord& date_time,
Handle<JSReceiver> calendar,
const DurationRecord& dur,
Handle<Object> options) { … }
Maybe<TimeDurationRecord> BalanceDuration(Isolate* isolate, Unit largest_unit,
const TimeDurationRecord& duration,
const char* method_name) { … }
Maybe<TimeDurationRecord> BalanceDuration(Isolate* isolate, Unit largest_unit,
Handle<BigInt> nanoseconds,
const char* method_name) { … }
Maybe<TimeDurationRecord> BalanceDuration(Isolate* isolate, Unit largest_unit,
const TimeDurationRecord& dur1,
const TimeDurationRecord& dur2,
const char* method_name) { … }
Maybe<TimeDurationRecord> BalanceDuration(Isolate* isolate, Unit largest_unit,
Handle<Object> relative_to_obj,
const TimeDurationRecord& value,
const char* method_name) { … }
Maybe<BalancePossiblyInfiniteDurationResult> BalancePossiblyInfiniteDuration(
Isolate* isolate, Unit largest_unit, Handle<Object> relative_to_obj,
const TimeDurationRecord& value, const char* method_name) { … }
Maybe<BalancePossiblyInfiniteDurationResult> BalancePossiblyInfiniteDuration(
Isolate* isolate, Unit largest_unit, Handle<Object> relative_to_obj,
double days, Handle<BigInt> nanoseconds, const char* method_name) { … }
MaybeHandle<BigInt> AddZonedDateTime(Isolate* isolate,
Handle<BigInt> epoch_nanoseconds,
Handle<JSReceiver> time_zone,
Handle<JSReceiver> calendar,
const DurationRecord& duration,
const char* method_name) { … }
MaybeHandle<BigInt> AddZonedDateTime(Isolate* isolate,
Handle<BigInt> epoch_nanoseconds,
Handle<JSReceiver> time_zone,
Handle<JSReceiver> calendar,
const DurationRecord& duration,
Handle<Object> options,
const char* method_name) { … }
Maybe<NanosecondsToDaysResult> NanosecondsToDays(Isolate* isolate,
Handle<BigInt> nanoseconds,
Handle<Object> relative_to_obj,
const char* method_name) { … }
Maybe<DurationRecord> DifferenceISODateTime(
Isolate* isolate, const DateTimeRecord& date_time1,
const DateTimeRecord& date_time2, Handle<JSReceiver> calendar,
Unit largest_unit, Handle<JSReceiver> options, const char* method_name) { … }
MaybeHandle<BigInt> AddInstant(Isolate* isolate,
Handle<BigInt> epoch_nanoseconds,
const TimeDurationRecord& addend) { … }
bool IsValidEpochNanoseconds(Isolate* isolate,
DirectHandle<BigInt> epoch_nanoseconds) { … }
Handle<BigInt> GetEpochFromISOParts(Isolate* isolate,
const DateTimeRecord& date_time) { … }
}
namespace temporal {
int32_t DurationRecord::Sign(const DurationRecord& dur) { … }
bool IsValidDuration(Isolate* isolate, const DurationRecord& dur) { … }
}
namespace {
bool IsISOLeapYear(Isolate* isolate, int32_t year) { … }
int32_t ISODaysInMonth(Isolate* isolate, int32_t year, int32_t month) { … }
int32_t ISODaysInYear(Isolate* isolate, int32_t year) { … }
bool IsValidTime(Isolate* isolate, const TimeRecord& time) { … }
bool IsValidISODate(Isolate* isolate, const DateRecord& date) { … }
int32_t CompareISODate(const DateRecord& one, const DateRecord& two) { … }
int32_t CompareTemporalTime(const TimeRecord& time1, const TimeRecord& time2);
int32_t CompareISODateTime(const DateTimeRecord& one,
const DateTimeRecord& two) { … }
inline int32_t floor_divid(int32_t a, int32_t b) { … }
void BalanceISOYearMonth(Isolate* isolate, int32_t* year, int32_t* month) { … }
DateTimeRecord BalanceTime(const UnbalancedTimeRecord& input) { … }
Maybe<TimeDurationRecord> DifferenceTime(Isolate* isolate,
const TimeRecord& time1,
const TimeRecord& time2) { … }
DateTimeRecord AddTime(Isolate* isolate, const TimeRecord& time,
const TimeDurationRecord& addend) { … }
Handle<BigInt> TotalDurationNanoseconds(Isolate* isolate,
const TimeDurationRecord& value,
double offset_shift) { … }
Maybe<DateRecord> RegulateISODate(Isolate* isolate, ShowOverflow overflow,
const DateRecord& date);
Maybe<int32_t> ResolveISOMonth(Isolate* isolate, Handle<JSReceiver> fields);
Maybe<DateRecord> ISOMonthDayFromFields(Isolate* isolate,
Handle<JSReceiver> fields,
Handle<JSReceiver> options,
const char* method_name) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalDuration::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> years, Handle<Object> months, Handle<Object> weeks,
Handle<Object> days, Handle<Object> hours, Handle<Object> minutes,
Handle<Object> seconds, Handle<Object> milliseconds,
Handle<Object> microseconds, Handle<Object> nanoseconds) { … }
namespace {
MaybeHandle<Object> ToRelativeTemporalObject(Isolate* isolate,
Handle<JSReceiver> options,
const char* method_name);
Unit DefaultTemporalLargestUnit(const DurationRecord& dur);
Handle<BigInt> RoundTemporalInstant(Isolate* isolate, Handle<BigInt> ns,
double increment, Unit unit,
RoundingMode rounding_mode);
TimeDurationRecord DifferenceInstant(Isolate* isolate, Handle<BigInt> ns1,
Handle<BigInt> ns2,
double rounding_increment,
Unit smallest_unit, Unit largest_unit,
RoundingMode rounding_mode,
const char* method_name);
Maybe<DurationRecord> DifferenceZonedDateTime(
Isolate* isolate, Handle<BigInt> ns1, Handle<BigInt> ns2,
Handle<JSReceiver> time_zone, Handle<JSReceiver> calendar,
Unit largest_unit, Handle<JSReceiver> options, const char* method_name);
Maybe<DurationRecord> AddDuration(Isolate* isolate, const DurationRecord& dur1,
const DurationRecord& dur2,
Handle<Object> relative_to_obj,
const char* method_name);
Maybe<DurationRecord> AdjustRoundedDurationDays(Isolate* isolate,
const DurationRecord& duration,
double increment, Unit unit,
RoundingMode rounding_mode,
Handle<Object> relative_to_obj,
const char* method_name) { … }
Maybe<int64_t> CalculateOffsetShift(Isolate* isolate,
Handle<Object> relative_to_obj,
const DateDurationRecord& dur,
const char* method_name) { … }
struct MoveRelativeDateResult { … };
Maybe<MoveRelativeDateResult> MoveRelativeDate(
Isolate* isolate, Handle<JSReceiver> calendar,
Handle<JSTemporalPlainDate> relative_to,
Handle<JSTemporalDuration> duration, const char* method_name);
Maybe<DateDurationRecord> UnbalanceDurationRelative(
Isolate* isolate, const DateDurationRecord& dur, Unit largest_unit,
Handle<Object> relative_to_obj, const char* method_name) { … }
Maybe<DateDurationRecord> BalanceDurationRelative(
Isolate* isolate, const DateDurationRecord& dur, Unit largest_unit,
Handle<Object> relative_to_obj, const char* method_name) { … }
}
MaybeHandle<Smi> JSTemporalDuration::Compare(Isolate* isolate,
Handle<Object> one_obj,
Handle<Object> two_obj,
Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalDuration> JSTemporalDuration::From(Isolate* isolate,
Handle<Object> item) { … }
namespace {
struct Maximum { … };
Maximum MaximumTemporalDurationRoundingIncrement(Unit unit);
Maybe<double> ToTemporalRoundingIncrement(Isolate* isolate,
Handle<JSReceiver> normalized_options,
double dividend,
bool dividend_is_defined,
bool inclusive);
MaybeHandle<JSTemporalZonedDateTime> MoveRelativeZonedDateTime(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
const DateDurationRecord& duration, const char* method_name);
Maybe<DurationRecordWithRemainder> RoundDuration(Isolate* isolate,
const DurationRecord& duration,
double increment, Unit unit,
RoundingMode rounding_mode,
Handle<Object> relative_to,
const char* method_name);
}
MaybeHandle<JSTemporalDuration> JSTemporalDuration::Round(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration,
Handle<Object> round_to_obj) { … }
MaybeHandle<Object> JSTemporalDuration::Total(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration,
Handle<Object> total_of_obj) { … }
namespace temporal {
Maybe<DurationRecord> ToPartialDuration(
Isolate* isolate, Handle<Object> temporal_duration_like_obj,
const DurationRecord& input) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalDuration::With(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration,
Handle<Object> temporal_duration_like) { … }
MaybeHandle<Smi> JSTemporalDuration::Sign(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration) { … }
MaybeHandle<Oddball> JSTemporalDuration::Blank(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration) { … }
namespace {
Maybe<DurationRecord> CreateNegatedDurationRecord(
Isolate* isolate, const DurationRecord& duration) { … }
MaybeHandle<JSTemporalDuration> CreateNegatedTemporalDuration(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalDuration::Negated(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration) { … }
MaybeHandle<JSTemporalDuration> JSTemporalDuration::Abs(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration) { … }
namespace {
MaybeHandle<BigInt> InterpretISODateTimeOffset(
Isolate* isolate, const DateTimeRecord& data,
OffsetBehaviour offset_behaviour, int64_t offset_nanoseconds,
Handle<JSReceiver> time_zone, Disambiguation disambiguation,
Offset offset_option, MatchBehaviour match_behaviour,
const char* method_name);
Maybe<temporal::DateTimeRecord> InterpretTemporalDateTimeFields(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<JSReceiver> fields,
Handle<Object> options, const char* method_name);
MaybeHandle<Object> ToRelativeTemporalObject(Isolate* isolate,
Handle<JSReceiver> options,
const char* method_name) { … }
Unit DefaultTemporalLargestUnit(const DurationRecord& dur) { … }
Maybe<DurationRecord> DifferenceZonedDateTime(
Isolate* isolate, Handle<BigInt> ns1, Handle<BigInt> ns2,
Handle<JSReceiver> time_zone, Handle<JSReceiver> calendar,
Unit largest_unit, Handle<JSReceiver> options, const char* method_name) { … }
Maybe<DurationRecord> AddDuration(Isolate* isolate, const DurationRecord& dur1,
const DurationRecord& dur2,
Handle<Object> relative_to_obj,
const char* method_name) { … }
MaybeHandle<JSTemporalDuration> AddDurationToOrSubtractDurationFromDuration(
Isolate* isolate, Arithmetic operation,
DirectHandle<JSTemporalDuration> duration, Handle<Object> other_obj,
Handle<Object> options_obj, const char* method_name) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalDuration::Add(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSTemporalDuration> JSTemporalDuration::Subtract(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<String> JSTemporalDuration::ToJSON(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration) { … }
MaybeHandle<String> JSTemporalDuration::ToLocaleString(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration,
DirectHandle<Object> locales, DirectHandle<Object> options) { … }
namespace {
MaybeHandle<JSTemporalZonedDateTime> MoveRelativeZonedDateTime(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
const DateDurationRecord& duration, const char* method_name) { … }
double DaysUntil(Isolate* isolate, DirectHandle<JSTemporalPlainDate> earlier,
DirectHandle<JSTemporalPlainDate> later,
const char* method_name) { … }
Maybe<MoveRelativeDateResult> MoveRelativeDate(
Isolate* isolate, Handle<JSReceiver> calendar,
Handle<JSTemporalPlainDate> relative_to,
Handle<JSTemporalDuration> duration, const char* method_name) { … }
Maybe<DurationRecordWithRemainder> RoundDuration(Isolate* isolate,
const DurationRecord& duration,
double increment, Unit unit,
RoundingMode rounding_mode,
Handle<Object> relative_to,
const char* method_name) { … }
Maybe<DurationRecordWithRemainder> RoundDuration(Isolate* isolate,
const DurationRecord& duration,
double increment, Unit unit,
RoundingMode rounding_mode,
const char* method_name) { … }
struct StringPrecision { … };
Maybe<StringPrecision> ToSecondsStringPrecision(
Isolate* isolate, Handle<JSReceiver> normalized_options,
const char* method_name);
}
MaybeHandle<String> JSTemporalDuration::ToString(
Isolate* isolate, DirectHandle<JSTemporalDuration> duration,
Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalCalendar> JSTemporalCalendar::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> identifier_obj) { … }
namespace {
int32_t ToISODayOfYear(Isolate* isolate, const DateRecord& date) { … }
bool IsPlainDatePlainDateTimeOrPlainYearMonth(
DirectHandle<Object> temporal_date_like) { … }
int32_t ToISODayOfWeek(Isolate* isolate, const DateRecord& date) { … }
Maybe<DateRecord> RegulateISODate(Isolate* isolate, ShowOverflow overflow,
const DateRecord& date) { … }
Maybe<int32_t> RegulateISOYearMonth(Isolate* isolate, ShowOverflow overflow,
int32_t month) { … }
Maybe<int32_t> ResolveISOMonth(Isolate* isolate, Handle<JSReceiver> fields) { … }
Maybe<DateRecord> ISODateFromFields(Isolate* isolate, Handle<JSReceiver> fields,
Handle<JSReceiver> options,
const char* method_name) { … }
Maybe<DateRecord> AddISODate(Isolate* isolate, const DateRecord& date,
const DateDurationRecord& duration,
ShowOverflow overflow) { … }
Maybe<DateDurationRecord> DifferenceISODate(Isolate* isolate,
const DateRecord& date1,
const DateRecord& date2,
Unit largest_unit,
const char* method_name) { … }
Maybe<DateRecord> ISOYearMonthFromFields(Isolate* isolate,
Handle<JSReceiver> fields,
Handle<JSReceiver> options,
const char* method_name) { … }
int32_t ToISOWeekOfYear(Isolate* isolate, const DateRecord& date) { … }
}
MaybeHandle<JSTemporalPlainDate> JSTemporalCalendar::DateAdd(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> date_obj, Handle<Object> duration_obj,
Handle<Object> options_obj) { … }
MaybeHandle<Smi> JSTemporalCalendar::DaysInYear(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Smi> JSTemporalCalendar::DaysInMonth(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Smi> JSTemporalCalendar::Year(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Smi> JSTemporalCalendar::DayOfYear(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Smi> JSTemporalCalendar::DayOfWeek(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Smi> JSTemporalCalendar::MonthsInYear(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Oddball> JSTemporalCalendar::InLeapYear(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Smi> JSTemporalCalendar::DaysInWeek(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalCalendar::DateFromFields(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> fields_obj, Handle<Object> options_obj) { … }
MaybeHandle<JSReceiver> JSTemporalCalendar::MergeFields(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> fields_obj, Handle<Object> additional_fields_obj) { … }
MaybeHandle<JSTemporalDuration> JSTemporalCalendar::DateUntil(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> one_obj, Handle<Object> two_obj,
Handle<Object> options_obj) { … }
MaybeHandle<Smi> JSTemporalCalendar::Day(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<String> JSTemporalCalendar::MonthCode(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Smi> JSTemporalCalendar::Month(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<JSTemporalPlainMonthDay> JSTemporalCalendar::MonthDayFromFields(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> fields_obj, Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalCalendar::YearMonthFromFields(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> fields_obj, Handle<Object> options_obj) { … }
#ifdef V8_INTL_SUPPORT
MaybeHandle<Object> JSTemporalCalendar::Era(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<Object> JSTemporalCalendar::EraYear(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
#endif
MaybeHandle<Smi> JSTemporalCalendar::WeekOfYear(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
Handle<Object> temporal_date_like) { … }
MaybeHandle<String> JSTemporalCalendar::ToString(
Isolate* isolate, DirectHandle<JSTemporalCalendar> calendar,
const char* method_name) { … }
MaybeHandle<JSTemporalTimeZone> JSTemporalTimeZone::Now(Isolate* isolate) { … }
MaybeHandle<JSTemporalTimeZone> JSTemporalTimeZone::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> identifier_obj) { … }
namespace {
MaybeHandle<JSTemporalPlainDateTime> ToTemporalDateTime(
Isolate* isolate, Handle<Object> item_obj, Handle<Object> options,
const char* method_name);
MaybeHandle<JSTemporalPlainDateTime> ToTemporalDateTime(
Isolate* isolate, Handle<Object> item_obj, const char* method_name) { … }
}
MaybeHandle<JSTemporalInstant> JSTemporalTimeZone::GetInstantFor(
Isolate* isolate, Handle<JSTemporalTimeZone> time_zone,
Handle<Object> date_time_obj, Handle<Object> options_obj) { … }
namespace {
#ifdef V8_INTL_SUPPORT
Handle<Object> GetIANATimeZoneTransition(Isolate* isolate,
Handle<BigInt> nanoseconds,
int32_t time_zone_index,
Intl::Transition transition) { … }
Handle<Object> GetIANATimeZoneNextTransition(Isolate* isolate,
Handle<BigInt> nanoseconds,
int32_t time_zone_index) { … }
Handle<Object> GetIANATimeZonePreviousTransition(Isolate* isolate,
Handle<BigInt> nanoseconds,
int32_t time_zone_index) { … }
Handle<Object> GetIANATimeZoneOffsetNanoseconds(Isolate* isolate,
Handle<BigInt> nanoseconds,
int32_t time_zone_index) { … }
#else
Handle<Object> GetIANATimeZoneNextTransition(Isolate* isolate, Handle<BigInt>,
int32_t) {
return isolate->factory()->null_value();
}
Handle<Object> GetIANATimeZonePreviousTransition(Isolate* isolate,
Handle<BigInt>, int32_t) {
return isolate->factory()->null_value();
}
Handle<Object> GetIANATimeZoneOffsetNanoseconds(Isolate* isolate,
Handle<BigInt>,
int32_t time_zone_index) {
DCHECK_EQ(time_zone_index, JSTemporalTimeZone::kUTCTimeZoneIndex);
return handle(Smi::zero(), isolate);
}
#endif
}
MaybeHandle<JSTemporalPlainDateTime> JSTemporalTimeZone::GetPlainDateTimeFor(
Isolate* isolate, Handle<JSTemporalTimeZone> time_zone,
Handle<Object> instant_obj, Handle<Object> calendar_like) { … }
template <Handle<Object> (*iana_func)(Isolate*, Handle<BigInt>, int32_t)>
MaybeHandle<Object> GetTransition(Isolate* isolate,
DirectHandle<JSTemporalTimeZone> time_zone,
Handle<Object> starting_point_obj,
const char* method_name) { … }
MaybeHandle<Object> JSTemporalTimeZone::GetNextTransition(
Isolate* isolate, DirectHandle<JSTemporalTimeZone> time_zone,
Handle<Object> starting_point_obj) { … }
MaybeHandle<Object> JSTemporalTimeZone::GetPreviousTransition(
Isolate* isolate, DirectHandle<JSTemporalTimeZone> time_zone,
Handle<Object> starting_point_obj) { … }
MaybeHandle<JSArray> GetIANATimeZoneEpochValueAsArrayOfInstantForUTC(
Isolate* isolate, const DateTimeRecord& date_time) { … }
#ifdef V8_INTL_SUPPORT
MaybeHandle<JSArray> GetIANATimeZoneEpochValueAsArrayOfInstant(
Isolate* isolate, int32_t time_zone_index,
const DateTimeRecord& date_time) { … }
#else
MaybeHandle<JSArray> GetIANATimeZoneEpochValueAsArrayOfInstant(
Isolate* isolate, int32_t time_zone_index,
const DateTimeRecord& date_time) {
DCHECK_EQ(time_zone_index, JSTemporalTimeZone::kUTCTimeZoneIndex);
return GetIANATimeZoneEpochValueAsArrayOfInstantForUTC(isolate, date_time);
}
#endif
MaybeHandle<JSArray> JSTemporalTimeZone::GetPossibleInstantsFor(
Isolate* isolate, DirectHandle<JSTemporalTimeZone> time_zone,
Handle<Object> date_time_obj) { … }
MaybeHandle<Object> JSTemporalTimeZone::GetOffsetNanosecondsFor(
Isolate* isolate, DirectHandle<JSTemporalTimeZone> time_zone,
Handle<Object> instant_obj) { … }
MaybeHandle<String> JSTemporalTimeZone::GetOffsetStringFor(
Isolate* isolate, Handle<JSTemporalTimeZone> time_zone,
Handle<Object> instant_obj) { … }
MaybeHandle<Object> JSTemporalTimeZone::ToString(
Isolate* isolate, DirectHandle<JSTemporalTimeZone> time_zone,
const char* method_name) { … }
int32_t JSTemporalTimeZone::time_zone_index() const { … }
int64_t JSTemporalTimeZone::offset_nanoseconds() const { … }
void JSTemporalTimeZone::set_offset_nanoseconds(int64_t ns) { … }
MaybeHandle<String> JSTemporalTimeZone::id(Isolate* isolate) const { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDate::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> iso_year_obj, Handle<Object> iso_month_obj,
Handle<Object> iso_day_obj, Handle<Object> calendar_like) { … }
MaybeHandle<Smi> JSTemporalPlainDate::Compare(Isolate* isolate,
Handle<Object> one_obj,
Handle<Object> two_obj) { … }
MaybeHandle<Oddball> JSTemporalPlainDate::Equals(
Isolate* isolate, DirectHandle<JSTemporalPlainDate> temporal_date,
Handle<Object> other_obj) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDate::WithCalendar(
Isolate* isolate, DirectHandle<JSTemporalPlainDate> temporal_date,
Handle<Object> calendar_like) { … }
template <typename T, typename R,
MaybeHandle<R> (*from_fields)(Isolate*, Handle<JSReceiver>,
Handle<JSReceiver>, Handle<Object>)>
MaybeHandle<R> ToPlain(Isolate* isolate, Handle<T> t, DirectHandle<String> f1,
DirectHandle<String> f2) { … }
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalPlainDate::ToPlainYearMonth(
Isolate* isolate, Handle<JSTemporalPlainDate> temporal_date) { … }
MaybeHandle<JSTemporalPlainMonthDay> JSTemporalPlainDate::ToPlainMonthDay(
Isolate* isolate, Handle<JSTemporalPlainDate> temporal_date) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDate::ToPlainDateTime(
Isolate* isolate, DirectHandle<JSTemporalPlainDate> temporal_date,
Handle<Object> temporal_time_obj) { … }
namespace {
Maybe<bool> RejectObjectWithCalendarOrTimeZone(Isolate* isolate,
Handle<JSReceiver> object) { … }
MaybeHandle<JSReceiver> CalendarMergeFields(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<JSReceiver> fields,
Handle<JSReceiver> additional_fields) { … }
template <typename T,
MaybeHandle<T> (*from_fields_func)(
Isolate*, Handle<JSReceiver>, Handle<JSReceiver>, Handle<Object>)>
MaybeHandle<T> PlainDateOrYearMonthOrMonthDayWith(
Isolate* isolate, Handle<T> temporal, Handle<Object> temporal_like_obj,
Handle<Object> options_obj, Handle<FixedArray> field_names,
const char* method_name) { … }
}
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDate::With(
Isolate* isolate, Handle<JSTemporalPlainDate> temporal_date,
Handle<Object> temporal_date_like_obj, Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalPlainDate::ToZonedDateTime(
Isolate* isolate, DirectHandle<JSTemporalPlainDate> temporal_date,
Handle<Object> item_obj) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDate::Add(
Isolate* isolate, Handle<JSTemporalPlainDate> temporal_date,
Handle<Object> temporal_duration_like, Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDate::Subtract(
Isolate* isolate, Handle<JSTemporalPlainDate> temporal_date,
Handle<Object> temporal_duration_like, Handle<Object> options_obj) { … }
namespace {
MaybeHandle<JSTemporalDuration> DifferenceTemporalPlainDate(
Isolate* isolate, TimePreposition operation,
Handle<JSTemporalPlainDate> temporal_date, Handle<Object> other_obj,
Handle<Object> options, const char* method_name) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalPlainDate::Until(
Isolate* isolate, Handle<JSTemporalPlainDate> handle, Handle<Object> other,
Handle<Object> options) { … }
MaybeHandle<JSTemporalDuration> JSTemporalPlainDate::Since(
Isolate* isolate, Handle<JSTemporalPlainDate> handle, Handle<Object> other,
Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDate::Now(
Isolate* isolate, Handle<Object> calendar_like,
Handle<Object> temporal_time_zone_like) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDate::NowISO(
Isolate* isolate, Handle<Object> temporal_time_zone_like) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDate::From(
Isolate* isolate, Handle<Object> item, Handle<Object> options_obj) { … }
#define DEFINE_INT_FIELD(obj, str, field, item) …
MaybeHandle<JSReceiver> JSTemporalPlainDate::GetISOFields(
Isolate* isolate, DirectHandle<JSTemporalPlainDate> temporal_date) { … }
MaybeHandle<String> JSTemporalPlainDate::ToJSON(
Isolate* isolate, DirectHandle<JSTemporalPlainDate> temporal_date) { … }
namespace {
Maybe<ShowCalendar> ToShowCalendarOption(Isolate* isolate,
Handle<JSReceiver> options,
const char* method_name) { … }
template <typename T,
MaybeHandle<String> (*F)(Isolate*, DirectHandle<T>, ShowCalendar)>
MaybeHandle<String> TemporalToString(Isolate* isolate, DirectHandle<T> temporal,
Handle<Object> options_obj,
const char* method_name) { … }
}
MaybeHandle<String> JSTemporalPlainDate::ToString(
Isolate* isolate, DirectHandle<JSTemporalPlainDate> temporal_date,
Handle<Object> options) { … }
MaybeHandle<String> JSTemporalPlainDate::ToLocaleString(
Isolate* isolate, Handle<JSTemporalPlainDate> temporal_date,
Handle<Object> locales, Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> iso_year_obj, Handle<Object> iso_month_obj,
Handle<Object> iso_day_obj, Handle<Object> hour_obj,
Handle<Object> minute_obj, Handle<Object> second_obj,
Handle<Object> millisecond_obj, Handle<Object> microsecond_obj,
Handle<Object> nanosecond_obj, Handle<Object> calendar_like) { … }
namespace {
Maybe<temporal::DateTimeRecord> InterpretTemporalDateTimeFields(
Isolate* isolate, Handle<JSReceiver> calendar, Handle<JSReceiver> fields,
Handle<Object> options, const char* method_name) { … }
Maybe<DateTimeRecordWithCalendar> ParseTemporalDateTimeString(
Isolate* isolate, Handle<String> iso_string) { … }
MaybeHandle<JSTemporalPlainDateTime> ToTemporalDateTime(
Isolate* isolate, Handle<Object> item_obj, Handle<Object> options,
const char* method_name) { … }
}
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::From(
Isolate* isolate, Handle<Object> item, Handle<Object> options_obj) { … }
MaybeHandle<Smi> JSTemporalPlainDateTime::Compare(Isolate* isolate,
Handle<Object> one_obj,
Handle<Object> two_obj) { … }
MaybeHandle<Oddball> JSTemporalPlainDateTime::Equals(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> other_obj) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::With(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time,
Handle<Object> temporal_date_time_like_obj, Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::WithPlainTime(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> plain_time_like) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::WithCalendar(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> calendar_like) { … }
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalPlainDateTime::ToPlainYearMonth(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time) { … }
MaybeHandle<JSTemporalPlainMonthDay> JSTemporalPlainDateTime::ToPlainMonthDay(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalPlainDateTime::ToZonedDateTime(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time,
Handle<Object> temporal_time_zone_like, Handle<Object> options_obj) { … }
namespace {
MaybeHandle<JSReceiver> ConsolidateCalendars(Isolate* isolate,
Handle<JSReceiver> one,
Handle<JSReceiver> two) { … }
}
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::WithPlainDate(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> temporal_date_like) { … }
namespace {
MaybeHandle<String> TemporalDateTimeToString(Isolate* isolate,
const DateTimeRecord& date_time,
Handle<JSReceiver> calendar,
Precision precision,
ShowCalendar show_calendar) { … }
}
MaybeHandle<String> JSTemporalPlainDateTime::ToJSON(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time) { … }
MaybeHandle<String> JSTemporalPlainDateTime::ToLocaleString(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time,
Handle<Object> locales, Handle<Object> options) { … }
namespace {
constexpr double kNsPerDay = …;
DateTimeRecord RoundTime(
Isolate* isolate, const TimeRecord& time, double increment, Unit unit,
RoundingMode rounding_mode,
double day_length_ns = kNsPerDay);
DateTimeRecord RoundISODateTime(
Isolate* isolate, const DateTimeRecord& date_time, double increment,
Unit unit, RoundingMode rounding_mode,
double day_length_ns = kNsPerDay) { … }
}
MaybeHandle<String> JSTemporalPlainDateTime::ToString(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::Now(
Isolate* isolate, Handle<Object> calendar_like,
Handle<Object> temporal_time_zone_like) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::NowISO(
Isolate* isolate, Handle<Object> temporal_time_zone_like) { … }
namespace {
Maybe<double> ToTemporalDateTimeRoundingIncrement(
Isolate* isolate, Handle<JSReceiver> normalized_option,
Unit smallest_unit) { … }
}
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::Round(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> round_to_obj) { … }
namespace {
MaybeHandle<JSTemporalPlainDateTime>
AddDurationToOrSubtractDurationFromPlainDateTime(
Isolate* isolate, Arithmetic operation,
DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> temporal_duration_like, Handle<Object> options_obj,
const char* method_name) { … }
}
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::Add(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> temporal_duration_like, Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainDateTime::Subtract(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time,
Handle<Object> temporal_duration_like, Handle<Object> options) { … }
namespace {
MaybeHandle<JSTemporalDuration> DifferenceTemporalPlainDateTime(
Isolate* isolate, TimePreposition operation,
DirectHandle<JSTemporalPlainDateTime> date_time, Handle<Object> other_obj,
Handle<Object> options, const char* method_name) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalPlainDateTime::Until(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSTemporalDuration> JSTemporalPlainDateTime::Since(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSReceiver> JSTemporalPlainDateTime::GetISOFields(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainDateTime::ToPlainDate(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time) { … }
MaybeHandle<JSTemporalPlainTime> JSTemporalPlainDateTime::ToPlainTime(
Isolate* isolate, DirectHandle<JSTemporalPlainDateTime> date_time) { … }
MaybeHandle<JSTemporalPlainMonthDay> JSTemporalPlainMonthDay::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> iso_month_obj, Handle<Object> iso_day_obj,
Handle<Object> calendar_like, Handle<Object> reference_iso_year_obj) { … }
namespace {
Maybe<DateRecordWithCalendar> ParseTemporalMonthDayString(
Isolate* isolate, Handle<String> iso_string) { … }
MaybeHandle<JSTemporalPlainMonthDay> ToTemporalMonthDay(
Isolate* isolate, Handle<Object> item_obj, Handle<Object> options,
const char* method_name) { … }
MaybeHandle<JSTemporalPlainMonthDay> ToTemporalMonthDay(
Isolate* isolate, Handle<Object> item_obj, const char* method_name) { … }
}
MaybeHandle<JSTemporalPlainMonthDay> JSTemporalPlainMonthDay::From(
Isolate* isolate, Handle<Object> item, Handle<Object> options_obj) { … }
MaybeHandle<Oddball> JSTemporalPlainMonthDay::Equals(
Isolate* isolate, DirectHandle<JSTemporalPlainMonthDay> month_day,
Handle<Object> other_obj) { … }
MaybeHandle<JSTemporalPlainMonthDay> JSTemporalPlainMonthDay::With(
Isolate* isolate, Handle<JSTemporalPlainMonthDay> temporal_month_day,
Handle<Object> temporal_month_day_like_obj, Handle<Object> options_obj) { … }
namespace {
template <typename T>
MaybeHandle<JSTemporalPlainDate> PlainMonthDayOrYearMonthToPlainDate(
Isolate* isolate, Handle<T> temporal, Handle<Object> item_obj,
DirectHandle<String> receiver_field_name_1,
DirectHandle<String> receiver_field_name_2,
DirectHandle<String> input_field_name) { … }
}
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainMonthDay::ToPlainDate(
Isolate* isolate, Handle<JSTemporalPlainMonthDay> month_day,
Handle<Object> item_obj) { … }
MaybeHandle<JSReceiver> JSTemporalPlainMonthDay::GetISOFields(
Isolate* isolate, DirectHandle<JSTemporalPlainMonthDay> month_day) { … }
MaybeHandle<String> JSTemporalPlainMonthDay::ToJSON(
Isolate* isolate, DirectHandle<JSTemporalPlainMonthDay> month_day) { … }
MaybeHandle<String> JSTemporalPlainMonthDay::ToString(
Isolate* isolate, DirectHandle<JSTemporalPlainMonthDay> month_day,
Handle<Object> options) { … }
MaybeHandle<String> JSTemporalPlainMonthDay::ToLocaleString(
Isolate* isolate, Handle<JSTemporalPlainMonthDay> month_day,
Handle<Object> locales, Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalPlainYearMonth::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> iso_year_obj, Handle<Object> iso_month_obj,
Handle<Object> calendar_like, Handle<Object> reference_iso_day_obj) { … }
namespace {
Maybe<DateRecordWithCalendar> ParseTemporalYearMonthString(
Isolate* isolate, Handle<String> iso_string) { … }
MaybeHandle<JSTemporalPlainYearMonth> ToTemporalYearMonth(
Isolate* isolate, Handle<Object> item_obj, Handle<Object> options,
const char* method_name) { … }
MaybeHandle<JSTemporalPlainYearMonth> ToTemporalYearMonth(
Isolate* isolate, Handle<Object> item_obj, const char* method_name) { … }
}
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalPlainYearMonth::From(
Isolate* isolate, Handle<Object> item, Handle<Object> options_obj) { … }
MaybeHandle<Smi> JSTemporalPlainYearMonth::Compare(Isolate* isolate,
Handle<Object> one_obj,
Handle<Object> two_obj) { … }
MaybeHandle<Oddball> JSTemporalPlainYearMonth::Equals(
Isolate* isolate, DirectHandle<JSTemporalPlainYearMonth> year_month,
Handle<Object> other_obj) { … }
namespace {
MaybeHandle<JSTemporalPlainYearMonth>
AddDurationToOrSubtractDurationFromPlainYearMonth(
Isolate* isolate, Arithmetic operation,
Handle<JSTemporalPlainYearMonth> year_month,
Handle<Object> temporal_duration_like, Handle<Object> options_obj,
const char* method_name) { … }
}
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalPlainYearMonth::Add(
Isolate* isolate, Handle<JSTemporalPlainYearMonth> year_month,
Handle<Object> temporal_duration_like, Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalPlainYearMonth::Subtract(
Isolate* isolate, Handle<JSTemporalPlainYearMonth> year_month,
Handle<Object> temporal_duration_like, Handle<Object> options) { … }
namespace {
MaybeHandle<JSTemporalDuration> DifferenceTemporalPlainYearMonth(
Isolate* isolate, TimePreposition operation,
Handle<JSTemporalPlainYearMonth> year_month, Handle<Object> other_obj,
Handle<Object> options, const char* method_name) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalPlainYearMonth::Until(
Isolate* isolate, Handle<JSTemporalPlainYearMonth> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSTemporalDuration> JSTemporalPlainYearMonth::Since(
Isolate* isolate, Handle<JSTemporalPlainYearMonth> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalPlainYearMonth::With(
Isolate* isolate, Handle<JSTemporalPlainYearMonth> temporal_year_month,
Handle<Object> temporal_year_month_like_obj, Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalPlainDate> JSTemporalPlainYearMonth::ToPlainDate(
Isolate* isolate, Handle<JSTemporalPlainYearMonth> year_month,
Handle<Object> item_obj) { … }
MaybeHandle<JSReceiver> JSTemporalPlainYearMonth::GetISOFields(
Isolate* isolate, DirectHandle<JSTemporalPlainYearMonth> year_month) { … }
MaybeHandle<String> JSTemporalPlainYearMonth::ToJSON(
Isolate* isolate, DirectHandle<JSTemporalPlainYearMonth> year_month) { … }
MaybeHandle<String> JSTemporalPlainYearMonth::ToString(
Isolate* isolate, DirectHandle<JSTemporalPlainYearMonth> year_month,
Handle<Object> options) { … }
MaybeHandle<String> JSTemporalPlainYearMonth::ToLocaleString(
Isolate* isolate, Handle<JSTemporalPlainYearMonth> year_month,
Handle<Object> locales, Handle<Object> options) { … }
MaybeHandle<JSTemporalPlainTime> JSTemporalPlainTime::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> hour_obj, Handle<Object> minute_obj,
Handle<Object> second_obj, Handle<Object> millisecond_obj,
Handle<Object> microsecond_obj, Handle<Object> nanosecond_obj) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalPlainTime::ToZonedDateTime(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> item_obj) { … }
namespace {
int32_t CompareTemporalTime(const TimeRecord& time1, const TimeRecord& time2) { … }
}
MaybeHandle<Smi> JSTemporalPlainTime::Compare(Isolate* isolate,
Handle<Object> one_obj,
Handle<Object> two_obj) { … }
MaybeHandle<Oddball> JSTemporalPlainTime::Equals(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> other_obj) { … }
namespace {
Maximum MaximumTemporalDurationRoundingIncrement(Unit unit) { … }
}
MaybeHandle<JSTemporalPlainTime> JSTemporalPlainTime::Round(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> round_to_obj) { … }
MaybeHandle<JSTemporalPlainTime> JSTemporalPlainTime::With(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> temporal_time_like_obj, Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalPlainTime> JSTemporalPlainTime::NowISO(
Isolate* isolate, Handle<Object> temporal_time_zone_like) { … }
MaybeHandle<JSTemporalPlainTime> JSTemporalPlainTime::From(
Isolate* isolate, Handle<Object> item_obj, Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalPlainTime::ToPlainDateTime(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> temporal_date_like) { … }
namespace {
MaybeHandle<JSTemporalPlainTime> AddDurationToOrSubtractDurationFromPlainTime(
Isolate* isolate, Arithmetic operation,
DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> temporal_duration_like, const char* method_name) { … }
}
MaybeHandle<JSTemporalPlainTime> JSTemporalPlainTime::Add(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> temporal_duration_like) { … }
MaybeHandle<JSTemporalPlainTime> JSTemporalPlainTime::Subtract(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> temporal_duration_like) { … }
namespace {
MaybeHandle<JSTemporalDuration> DifferenceTemporalPlainTime(
Isolate* isolate, TimePreposition operation,
DirectHandle<JSTemporalPlainTime> temporal_time, Handle<Object> other_obj,
Handle<Object> options, const char* method_name) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalPlainTime::Until(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSTemporalDuration> JSTemporalPlainTime::Since(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSReceiver> JSTemporalPlainTime::GetISOFields(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time) { … }
MaybeHandle<String> JSTemporalPlainTime::ToJSON(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time) { … }
MaybeHandle<String> JSTemporalPlainTime::ToLocaleString(
Isolate* isolate, Handle<JSTemporalPlainTime> temporal_time,
Handle<Object> locales, Handle<Object> options) { … }
namespace {
UnsignedRoundingMode GetUnsignedRoundingMode(RoundingMode rounding_mode,
bool is_negative) { … }
double ApplyUnsignedRoundingMode(double x, double r1, double r2,
UnsignedRoundingMode unsigned_rounding_mode) { … }
Handle<BigInt> ApplyUnsignedRoundingMode(
Isolate* isolate, Handle<BigInt> num, Handle<BigInt> increment,
Handle<BigInt> r1, Handle<BigInt> r2,
UnsignedRoundingMode unsigned_rounding_mode) { … }
double RoundNumberToIncrement(Isolate* isolate, double x, double increment,
RoundingMode rounding_mode) { … }
Handle<BigInt> RoundNumberToIncrementAsIfPositive(Isolate* isolate,
Handle<BigInt> x,
double increment,
RoundingMode rounding_mode) { … }
DateTimeRecord RoundTime(Isolate* isolate, const TimeRecord& time,
double increment, Unit unit,
RoundingMode rounding_mode, double day_length_ns) { … }
Maybe<StringPrecision> ToSecondsStringPrecision(
Isolate* isolate, Handle<JSReceiver> normalized_options,
const char* method_name) { … }
MaybeHandle<Smi> CompareEpochNanoseconds(Isolate* isolate,
DirectHandle<BigInt> one,
DirectHandle<BigInt> two) { … }
}
MaybeHandle<String> JSTemporalPlainTime::ToString(
Isolate* isolate, DirectHandle<JSTemporalPlainTime> temporal_time,
Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> epoch_nanoseconds_obj, Handle<Object> time_zone_like,
Handle<Object> calendar_like) { … }
MaybeHandle<Object> JSTemporalZonedDateTime::HoursInDay(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
namespace {
MaybeHandle<JSTemporalZonedDateTime> ToTemporalZonedDateTime(
Isolate* isolate, Handle<Object> item_obj, Handle<Object> options,
const char* method_name) { … }
MaybeHandle<JSTemporalZonedDateTime> ToTemporalZonedDateTime(
Isolate* isolate, Handle<Object> item_obj, const char* method_name) { … }
}
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::From(
Isolate* isolate, Handle<Object> item, Handle<Object> options_obj) { … }
MaybeHandle<Smi> JSTemporalZonedDateTime::Compare(Isolate* isolate,
Handle<Object> one_obj,
Handle<Object> two_obj) { … }
namespace {
Maybe<bool> TimeZoneEquals(Isolate* isolate, Handle<JSReceiver> one,
Handle<JSReceiver> two) { … }
}
MaybeHandle<Oddball> JSTemporalZonedDateTime::Equals(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> other_obj) { … }
namespace {
MaybeHandle<BigInt> InterpretISODateTimeOffset(
Isolate* isolate, const DateTimeRecord& data,
OffsetBehaviour offset_behaviour, int64_t offset_nanoseconds,
Handle<JSReceiver> time_zone, Disambiguation disambiguation,
Offset offset_option, MatchBehaviour match_behaviour,
const char* method_name) { … }
}
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::With(
Isolate* isolate, Handle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> temporal_zoned_date_time_like_obj,
Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::WithCalendar(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> calendar_like) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::WithPlainDate(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> plain_date_like) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::WithPlainTime(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> plain_time_like) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::WithTimeZone(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> time_zone_like) { … }
template <typename T,
MaybeHandle<T> (*from_fields_func)(
Isolate*, Handle<JSReceiver>, Handle<JSReceiver>, Handle<Object>)>
MaybeHandle<T> ZonedDateTimeToPlainYearMonthOrMonthDay(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
DirectHandle<String> field_name_1, DirectHandle<String> field_name_2,
const char* method_name) { … }
MaybeHandle<JSTemporalPlainYearMonth> JSTemporalZonedDateTime::ToPlainYearMonth(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<JSTemporalPlainMonthDay> JSTemporalZonedDateTime::ToPlainMonthDay(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
namespace {
MaybeHandle<String> TemporalZonedDateTimeToString(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Precision precision, ShowCalendar show_calendar,
ShowTimeZone show_time_zone, ShowOffset show_offset, double increment,
Unit unit, RoundingMode rounding_mode, const char* method_name) { … }
MaybeHandle<String> TemporalZonedDateTimeToString(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Precision precision, ShowCalendar show_calendar,
ShowTimeZone show_time_zone, ShowOffset show_offset,
const char* method_name) { … }
}
MaybeHandle<String> JSTemporalZonedDateTime::ToJSON(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<String> JSTemporalZonedDateTime::ToLocaleString(
Isolate* isolate, Handle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> locales, Handle<Object> options) { … }
MaybeHandle<String> JSTemporalZonedDateTime::ToString(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::Now(
Isolate* isolate, Handle<Object> calendar_like,
Handle<Object> temporal_time_zone_like) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::NowISO(
Isolate* isolate, Handle<Object> temporal_time_zone_like) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::Round(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> round_to_obj) { … }
namespace {
MaybeHandle<JSTemporalZonedDateTime>
AddDurationToOrSubtractDurationFromZonedDateTime(
Isolate* isolate, Arithmetic operation,
DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> temporal_duration_like, Handle<Object> options_obj,
const char* method_name) { … }
}
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::Add(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> temporal_duration_like, Handle<Object> options) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::Subtract(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> temporal_duration_like, Handle<Object> options) { … }
namespace {
MaybeHandle<JSTemporalDuration> DifferenceTemporalZonedDateTime(
Isolate* isolate, TimePreposition operation,
Handle<JSTemporalZonedDateTime> zoned_date_time, Handle<Object> other_obj,
Handle<Object> options, const char* method_name) { … }
}
MaybeHandle<JSTemporalDuration> JSTemporalZonedDateTime::Until(
Isolate* isolate, Handle<JSTemporalZonedDateTime> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSTemporalDuration> JSTemporalZonedDateTime::Since(
Isolate* isolate, Handle<JSTemporalZonedDateTime> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSReceiver> JSTemporalZonedDateTime::GetISOFields(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<JSTemporalInstant> JSTemporalInstant::Now(Isolate* isolate) { … }
MaybeHandle<Object> JSTemporalZonedDateTime::OffsetNanoseconds(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<String> JSTemporalZonedDateTime::Offset(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalZonedDateTime::StartOfDay(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<JSTemporalInstant> JSTemporalZonedDateTime::ToInstant(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
namespace {
MaybeHandle<JSTemporalPlainDateTime> ZonedDateTimeToPlainDateTime(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time,
const char* method_name) { … }
}
MaybeHandle<JSTemporalPlainDate> JSTemporalZonedDateTime::ToPlainDate(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<JSTemporalPlainTime> JSTemporalZonedDateTime::ToPlainTime(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<JSTemporalPlainDateTime> JSTemporalZonedDateTime::ToPlainDateTime(
Isolate* isolate, DirectHandle<JSTemporalZonedDateTime> zoned_date_time) { … }
MaybeHandle<JSTemporalInstant> JSTemporalInstant::Constructor(
Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target,
Handle<Object> epoch_nanoseconds_obj) { … }
namespace {
MaybeHandle<JSTemporalInstant> ScaleNumberToNanosecondsVerifyAndMake(
Isolate* isolate, Handle<BigInt> bigint, uint32_t scale) { … }
MaybeHandle<JSTemporalInstant> ScaleNumberToNanosecondsVerifyAndMake(
Isolate* isolate, Handle<Object> epoch_Xseconds, uint32_t scale) { … }
MaybeHandle<JSTemporalInstant> ScaleToNanosecondsVerifyAndMake(
Isolate* isolate, Handle<Object> epoch_Xseconds, uint32_t scale) { … }
}
MaybeHandle<JSTemporalInstant> JSTemporalInstant::FromEpochSeconds(
Isolate* isolate, Handle<Object> epoch_seconds) { … }
MaybeHandle<JSTemporalInstant> JSTemporalInstant::FromEpochMilliseconds(
Isolate* isolate, Handle<Object> epoch_milliseconds) { … }
MaybeHandle<JSTemporalInstant> JSTemporalInstant::FromEpochMicroseconds(
Isolate* isolate, Handle<Object> epoch_microseconds) { … }
MaybeHandle<JSTemporalInstant> JSTemporalInstant::FromEpochNanoseconds(
Isolate* isolate, Handle<Object> epoch_nanoseconds) { … }
MaybeHandle<Smi> JSTemporalInstant::Compare(Isolate* isolate,
Handle<Object> one_obj,
Handle<Object> two_obj) { … }
MaybeHandle<Oddball> JSTemporalInstant::Equals(
Isolate* isolate, DirectHandle<JSTemporalInstant> handle,
Handle<Object> other_obj) { … }
namespace {
Maybe<double> ToTemporalRoundingIncrement(Isolate* isolate,
Handle<JSReceiver> normalized_options,
double dividend,
bool dividend_is_defined,
bool inclusive) { … }
Handle<BigInt> RoundTemporalInstant(Isolate* isolate, Handle<BigInt> ns,
double increment, Unit unit,
RoundingMode rounding_mode) { … }
}
MaybeHandle<JSTemporalInstant> JSTemporalInstant::Round(
Isolate* isolate, DirectHandle<JSTemporalInstant> handle,
Handle<Object> round_to_obj) { … }
MaybeHandle<JSTemporalInstant> JSTemporalInstant::From(Isolate* isolate,
Handle<Object> item) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalInstant::ToZonedDateTime(
Isolate* isolate, DirectHandle<JSTemporalInstant> handle,
Handle<Object> item_obj) { … }
namespace {
MaybeHandle<String> TemporalInstantToString(Isolate* isolate,
Handle<JSTemporalInstant> instant,
Handle<Object> time_zone_obj,
Precision precision,
const char* method_name) { … }
}
MaybeHandle<String> JSTemporalInstant::ToJSON(
Isolate* isolate, Handle<JSTemporalInstant> instant) { … }
MaybeHandle<String> JSTemporalInstant::ToLocaleString(
Isolate* isolate, Handle<JSTemporalInstant> instant, Handle<Object> locales,
Handle<Object> options) { … }
MaybeHandle<String> JSTemporalInstant::ToString(
Isolate* isolate, DirectHandle<JSTemporalInstant> instant,
Handle<Object> options_obj) { … }
MaybeHandle<JSTemporalZonedDateTime> JSTemporalInstant::ToZonedDateTimeISO(
Isolate* isolate, DirectHandle<JSTemporalInstant> handle,
Handle<Object> item_obj) { … }
namespace {
MaybeHandle<JSTemporalInstant> AddDurationToOrSubtractDurationFromInstant(
Isolate* isolate, Arithmetic operation,
DirectHandle<JSTemporalInstant> handle,
Handle<Object> temporal_duration_like, const char* method_name) { … }
RoundingMode NegateTemporalRoundingMode(RoundingMode rounding_mode) { … }
Maybe<DifferenceSettings> GetDifferenceSettings(
Isolate* isolate, TimePreposition operation, Handle<Object> options,
UnitGroup unit_group, DisallowedUnitsInDifferenceSettings disallowed_units,
Unit fallback_smallest_unit, Unit smallest_largest_default_unit,
const char* method_name) { … }
TimeDurationRecord DifferenceInstant(Isolate* isolate, Handle<BigInt> ns1,
Handle<BigInt> ns2,
double rounding_increment,
Unit smallest_unit, Unit largest_unit,
RoundingMode rounding_mode,
const char* method_name) { … }
MaybeHandle<JSTemporalDuration> DifferenceTemporalInstant(
Isolate* isolate, TimePreposition operation,
DirectHandle<JSTemporalInstant> instant, Handle<Object> other_obj,
Handle<Object> options, const char* method_name) { … }
}
MaybeHandle<JSTemporalInstant> JSTemporalInstant::Add(
Isolate* isolate, DirectHandle<JSTemporalInstant> handle,
Handle<Object> temporal_duration_like) { … }
MaybeHandle<JSTemporalInstant> JSTemporalInstant::Subtract(
Isolate* isolate, DirectHandle<JSTemporalInstant> handle,
Handle<Object> temporal_duration_like) { … }
MaybeHandle<JSTemporalDuration> JSTemporalInstant::Until(
Isolate* isolate, DirectHandle<JSTemporalInstant> handle,
Handle<Object> other, Handle<Object> options) { … }
MaybeHandle<JSTemporalDuration> JSTemporalInstant::Since(
Isolate* isolate, DirectHandle<JSTemporalInstant> handle,
Handle<Object> other, Handle<Object> options) { … }
namespace temporal {
MaybeHandle<Oddball> IsInvalidTemporalCalendarField(
Isolate* isolate, Handle<String> next_value,
DirectHandle<FixedArray> fields_name) { … }
MaybeHandle<JSTemporalCalendar> GetBuiltinCalendar(Isolate* isolate,
Handle<String> id) { … }
MaybeHandle<JSTemporalInstant> BuiltinTimeZoneGetInstantForCompatible(
Isolate* isolate, Handle<JSReceiver> time_zone,
Handle<JSTemporalPlainDateTime> date_time, const char* method_name) { … }
}
}