Skip to content

Commit

Permalink
Editorial: Use ISO Date(-Time) Record in ISODate(Time)WithinLimits
Browse files Browse the repository at this point in the history
Instead of passing each component individually.

See: #2949
  • Loading branch information
ptomato authored and Ms2ger committed Oct 8, 2024
1 parent 0baee30 commit 7d3fe71
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 62 deletions.
41 changes: 21 additions & 20 deletions polyfill/lib/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ export function ToTemporalZonedDateTime(item, options = undefined) {

export function CreateTemporalDateSlots(result, isoYear, isoMonth, isoDay, calendar) {
RejectISODate(isoYear, isoMonth, isoDay);
RejectDateRange(isoYear, isoMonth, isoDay);
RejectDateRange({ year: isoYear, month: isoMonth, day: isoDay });

CreateSlots(result);
SetSlot(result, ISO_YEAR, isoYear);
Expand Down Expand Up @@ -1712,7 +1712,18 @@ export function CreateTemporalDate(isoYear, isoMonth, isoDay, calendar = 'iso860

export function CreateTemporalDateTimeSlots(result, isoYear, isoMonth, isoDay, h, min, s, ms, µs, ns, calendar) {
RejectDateTime(isoYear, isoMonth, isoDay, h, min, s, ms, µs, ns);
RejectDateTimeRange(isoYear, isoMonth, isoDay, h, min, s, ms, µs, ns);
const iso = {
year: isoYear,
month: isoMonth,
day: isoDay,
hour: h,
minute: min,
second: s,
millisecond: ms,
microsecond: µs,
nanosecond: ns
};
RejectDateTimeRange(iso);

CreateSlots(result);
SetSlot(result, ISO_YEAR, isoYear);
Expand All @@ -1727,17 +1738,6 @@ export function CreateTemporalDateTimeSlots(result, isoYear, isoMonth, isoDay, h
SetSlot(result, CALENDAR, calendar);

if (typeof __debug__ !== 'undefined' && __debug__) {
const iso = {
year: isoYear,
month: isoMonth,
day: isoDay,
hour: h,
minute: min,
second: s,
millisecond: ms,
microsecond: µs,
nanosecond: ns
};
let repr = TemporalDateTimeToString(iso, calendar, 'auto');
ObjectDefineProperty(result, '_repr_', {
value: `Temporal.PlainDateTime <${repr}>`,
Expand All @@ -1757,7 +1757,7 @@ export function CreateTemporalDateTime(isoYear, isoMonth, isoDay, h, min, s, ms,

export function CreateTemporalMonthDaySlots(result, isoMonth, isoDay, calendar, referenceISOYear) {
RejectISODate(referenceISOYear, isoMonth, isoDay);
RejectDateRange(referenceISOYear, isoMonth, isoDay);
RejectDateRange({ year: referenceISOYear, month: isoMonth, day: isoDay });

CreateSlots(result);
SetSlot(result, ISO_MONTH, isoMonth);
Expand Down Expand Up @@ -1864,7 +1864,7 @@ export function CalendarMergeFields(calendar, fields, additionalFields) {

export function CalendarDateAdd(calendar, isoDate, dateDuration, overflow) {
const result = calendarImplForID(calendar).dateAdd(isoDate, dateDuration, overflow);
RejectDateRange(result.year, result.month, result.day);
RejectDateRange(result);
return result;
}

Expand Down Expand Up @@ -1912,7 +1912,7 @@ export function CalendarDateFromFields(calendar, fields, overflow) {
const calendarImpl = calendarImplForID(calendar);
calendarImpl.resolveFields(fields, 'date');
const result = calendarImpl.dateToISO(fields, overflow);
RejectDateRange(result.year, result.month, result.day);
RejectDateRange(result);
return result;
}

Expand Down Expand Up @@ -2927,9 +2927,10 @@ export function RejectISODate(year, month, day) {
RejectToRange(day, 1, ISODaysInMonth(year, month));
}

export function RejectDateRange(year, month, day) {
function RejectDateRange(isoDate) {
// Noon avoids trouble at edges of DateTime range (excludes midnight)
RejectDateTimeRange(year, month, day, 12, 0, 0, 0, 0, 0);
const noon = { hour: 12, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 };
RejectDateTimeRange(CombineISODateAndTimeRecord(isoDate, noon));
}

export function RejectTime(hour, minute, second, millisecond, microsecond, nanosecond) {
Expand All @@ -2946,7 +2947,7 @@ export function RejectDateTime(year, month, day, hour, minute, second, milliseco
RejectTime(hour, minute, second, millisecond, microsecond, nanosecond);
}

export function RejectDateTimeRange(year, month, day, hour, minute, second, millisecond, microsecond, nanosecond) {
export function RejectDateTimeRange({ year, month, day, hour, minute, second, millisecond, microsecond, nanosecond }) {
const ns = GetUTCEpochNanoseconds(year, month, day, hour, minute, second, millisecond, microsecond, nanosecond);
if (ns.lesser(DATETIME_NS_MIN) || ns.greater(DATETIME_NS_MAX)) {
// Because PlainDateTime's range is wider than Instant's range, the line
Expand Down Expand Up @@ -4381,7 +4382,7 @@ export function AddDurationToYearMonth(operation, yearMonth, durationLike, optio
startDate = BalanceISODate(nextMonth.year, nextMonth.month, nextMonth.day - 1);
}
const durationToAdd = NormalizeDurationWithoutTime(duration);
RejectDateRange(startDate.year, startDate.month, startDate.day);
RejectDateRange(startDate);
const addedDate = CalendarDateAdd(calendar, startDate, durationToAdd, overflow);
const addedDateFields = ISODateToFields(calendar, addedDate, 'year-month');

Expand Down
12 changes: 1 addition & 11 deletions polyfill/lib/plaindatetime.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -389,17 +389,7 @@ export class PlainDateTime {
unit,
roundingMode
);
ES.RejectDateTimeRange(
result.year,
result.month,
result.day,
result.hour,
result.minute,
result.second,
result.millisecond,
result.microsecond,
result.nanosecond
);
ES.RejectDateTimeRange(result);
return ES.TemporalDateTimeToString(result, GetSlot(this, CALENDAR), precision, showCalendar);
}
toJSON() {
Expand Down
2 changes: 1 addition & 1 deletion spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ <h1>ISO Date-Time Parse Records</h1>
<p>An <dfn variants="ISO Date-Time Parse Records">ISO Date-Time Parse Record</dfn> is a Record value used to represent the result of parsing an ISO 8601 string.</p>
<p>
For any ISO Date-Time Parse Record _r_, IsValidISODate(_r_.[[Year]], _r_.[[Month]], _r_.[[Day]]) must return *true*, or, if _r_.[[Year]] is ~empty~, IsValidISODate(1972, _r_.[[Month]], _r_.[[Day]]) must return *true*.
It is not necessary for ISODateTimeWithinLimits(_r_.[[Year]], _r_.[[Month]], _r_.[[Day]], 0, 0, 0, 0, 0, 0) to return *true*.
It is not necessary for the represented date and time to be within the range given by ISODateTimeWithinLimits.
</p>
<p>ISO Date-Time Parse Records have the fields listed in <emu-xref href="#table-temporal-iso-date-time-parse-record-fields"></emu-xref>.</p>
<emu-table id="table-temporal-iso-date-time-parse-record-fields" caption="ISO Date-Time Parse Record Fields">
Expand Down
4 changes: 2 additions & 2 deletions spec/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ <h1>
1. Let _result_ be BalanceISODate(_intermediate_.[[Year]], _intermediate_.[[Month]], _d_).
1. Else,
1. Let _result_ be an implementation-defined ISO Date Record, or throw a *RangeError* exception, as described below.
1. If ISODateWithinLimits(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]) is *false*, throw a *RangeError* exception.
1. If ISODateWithinLimits(_result_) is *false*, throw a *RangeError* exception.
1. Return _result_.
</emu-alg>
<p>
Expand Down Expand Up @@ -564,7 +564,7 @@ <h1>
<emu-alg>
1. Perform ? CalendarResolveFields(_calendar_, _fields_, ~date~).
1. Let _result_ be ? CalendarDateToISO(_calendar_, _fields_, _overflow_).
1. If ISODateWithinLimits(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]) is *false*, throw a *RangeError* exception.
1. If ISODateWithinLimits(_result_) is *false*, throw a *RangeError* exception.
1. Return _result_.
</emu-alg>
</emu-clause>
Expand Down
15 changes: 8 additions & 7 deletions spec/plaindate.html
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ <h1>Temporal.PlainDate.prototype.toZonedDateTime ( _item_ )</h1>
1. Set _temporalTime_ to ? ToTemporalTime(_temporalTime_).
1. Let _timeRecord_ be Time Record { [[Days]]: 0, [[Hour]]: _temporalTime_.[[ISOHour]], [[Minute]]: _temporalTime_.[[ISOMinute]], [[Second]]: _temporalTime_.[[ISOSecond]], [[Millisecond]]: _temporalTime_.[[ISOMillisecond]], [[Microsecond]]: _temporalTime_.[[ISOMicrosecond]], [[Nanosecond]]: _temporalTime_.[[ISONanosecond]] }.
1. Let _isoDateTime_ be CombineISODateAndTimeRecord(_isoDate_, _timeRecord_).
1. If ISODateTimeWithinLimits(_isoDateTime_.[[Year]], _isoDateTime_.[[Month]], _isoDateTime_.[[Day]], _isoDateTime_.[[Hour]], _isoDateTime_.[[Minute]], _isoDateTime_.[[Second]], _isoDateTime_.[[Millisecond]], _isoDateTime_.[[Microsecond]], _isoDateTime_.[[Nanosecond]]) is *false*, throw a *RangeError* exception.
1. If ISODateTimeWithinLimits(_isoDateTime_) is *false*, throw a *RangeError* exception.
1. Let _epochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _isoDateTime_, ~compatible~).
1. Return ! CreateTemporalZonedDateTime(_epochNs_, _timeZone_, _temporalDate_.[[Calendar]]).
</emu-alg>
Expand Down Expand Up @@ -704,7 +704,8 @@ <h1>
</dl>
<emu-alg>
1. If IsValidISODate(_isoYear_, _isoMonth_, _isoDay_) is *false*, throw a *RangeError* exception.
1. If ISODateWithinLimits(_isoYear_, _isoMonth_, _isoDay_) is *false*, throw a *RangeError* exception.
1. Let _isoDate_ be CreateISODateRecord(_isoYear_, _isoMonth_, _isoDay_).
1. If ISODateWithinLimits(_isoDate_) is *false*, throw a *RangeError* exception.
1. If _newTarget_ is not present, set _newTarget_ to %Temporal.PlainDate%.
1. Let _object_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Temporal.PlainDate.prototype%"*, « [[InitializedTemporalDate]], [[ISOYear]], [[ISOMonth]], [[ISODay]], [[Calendar]] »).
1. Set _object_.[[ISOYear]] to _isoYear_.
Expand Down Expand Up @@ -906,20 +907,20 @@ <h1>
<emu-clause id="sec-temporal-isodatewithinlimits" type="abstract operation">
<h1>
ISODateWithinLimits (
_year_: an integer,
_month_: an integer between 1 and 12 inclusive,
_day_: an integer between 1 and 31 inclusive,
_isoDate_: an ISO Date Record,
): a Boolean
</h1>
<dl class="header">
<dt>description</dt>
<dd>The return value is *true* if the date in the ISO 8601 calendar given by the arguments is within the representable range of `Temporal.PlainDate`, and *false* otherwise.</dd>
<dd>The return value is *true* if the date in the ISO 8601 calendar given by the argument is within the representable range of `Temporal.PlainDate`, and *false* otherwise.</dd>
</dl>
<emu-note>
<p>Deferring to ISODateTimeWithinLimits with an hour of 12 avoids trouble at the extremes of the representable range of Temporal.PlainDateTime, which stops just before midnight on each end.</p>
</emu-note>
<emu-alg>
1. Return ISODateTimeWithinLimits(_year_, _month_, _day_, 12, 0, 0, 0, 0, 0).
1. Let _noon_ be Time Record { [[Days]]: 0, [[Hour]]: 12, [[Minute]]: 0, [[Second]]: 0, [[Millisecond]]: 0, [[Microsecond]]: 0, [[Nanosecond]]: 0 }.
1. Let _isoDateTime_ be CombineISODateAndTimeRecord(_isoDate_, _noon_).
1. Return ISODateTimeWithinLimits(_isoDateTime_).
</emu-alg>
</emu-clause>

Expand Down
31 changes: 13 additions & 18 deletions spec/plaindatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ <h1>Temporal.PlainDateTime.prototype.toString ( [ _options_ ] )</h1>
1. If _smallestUnit_ is ~hour~, throw a *RangeError* exception.
1. Let _precision_ be ToSecondsStringPrecisionRecord(_smallestUnit_, _digits_).
1. Let _result_ be RoundISODateTime(_dateTime_.[[ISOYear]], _dateTime_.[[ISOMonth]], _dateTime_.[[ISODay]], _dateTime_.[[ISOHour]], _dateTime_.[[ISOMinute]], _dateTime_.[[ISOSecond]], _dateTime_.[[ISOMillisecond]], _dateTime_.[[ISOMicrosecond]], _dateTime_.[[ISONanosecond]], _precision_.[[Increment]], _precision_.[[Unit]], _roundingMode_).
1. If ISODateTimeWithinLimits(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]], _result_.[[Hour]], _result_.[[Minute]], _result_.[[Second]], _result_.[[Millisecond]], _result_.[[Microsecond]], _result_.[[Nanosecond]]) is *false*, throw a *RangeError* exception.
1. If ISODateTimeWithinLimits(_result_) is *false*, throw a *RangeError* exception.
1. Return TemporalDateTimeToString(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]], _result_.[[Hour]], _result_.[[Minute]], _result_.[[Second]], _result_.[[Millisecond]], _result_.[[Microsecond]], _result_.[[Nanosecond]], _dateTime_.[[Calendar]], _precision_.[[Precision]], _showCalendar_).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -755,7 +755,7 @@ <h1>ISO Date-Time Records</h1>
<p>
An <dfn variants="ISO Date-Time Records">ISO Date-Time Record</dfn> is a Record value used to represent a valid calendar date in the ISO 8601 calendar together with a clock time.
For any ISO Date-Time Record _r_, IsValidISODate(_r_.[[Year]], _r_.[[Month]], _r_.[[Day]]) must return *true*, and IsValidTime(_r_.[[Hour]], _r_.[[Minute]], _r_.[[Second]], _r_.[[Millisecond]], _r_.[[Microsecond]], _r_.[[Nanosecond]]) must return *true*.
It is not necessary for ISODateTimeWithinLimits(_r_.[[Year]], _r_.[[Month]], _r_.[[Day]], _r_.[[Hour]], _r_.[[Minute]], _r_.[[Second]], _r_.[[Millisecond]], _r_.[[Microsecond]], _r_.[[Nanosecond]]) to return *true*.
It is not necessary for ISODateTimeWithinLimits(_r_) to return *true*.
</p>
<p>ISO Date-Time Records have the fields listed in <emu-xref href="#table-temporal-iso-date-time-record-fields"></emu-xref>.</p>
<emu-table id="table-temporal-iso-date-time-record-fields" caption="ISO Date-Time Record Fields">
Expand Down Expand Up @@ -858,15 +858,7 @@ <h1>
<emu-clause id="sec-temporal-isodatetimewithinlimits" type="abstract operation">
<h1>
ISODateTimeWithinLimits (
_year_: an integer,
_month_: an integer between 1 and 12 inclusive,
_day_: an integer between 1 and 31 inclusive,
_hour_: an integer between 0 and 23 inclusive,
_minute_: an integer between 0 and 59 inclusive,
_second_: an integer between 0 and 59 inclusive,
_millisecond_: an integer between 0 and 999 inclusive,
_microsecond_: an integer between 0 and 999 inclusive,
_nanosecond_: an integer between 0 and 999 inclusive,
_isoDateTime_: an ISO Date-Time Record,
): a Boolean
</h1>
<dl class="header">
Expand All @@ -880,9 +872,8 @@ <h1>
</p>
</emu-note>
<emu-alg>
1. Assert: IsValidISODate(_year_, _month_, _day_) is *true*.
1. If abs(ISODateToEpochDays(_year_, _month_ - 1, _day_)) > 10<sup>8</sup> + 1, return *false*.
1. Let _ns_ be ℝ(GetUTCEpochNanoseconds(_year_, _month_, _day_, _hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_)).
1. If abs(ISODateToEpochDays(_isoDateTime_.[[Year]], _isoDateTime_.[[Month]] - 1, _isoDateTime_.[[Day]])) > 10<sup>8</sup> + 1, return *false*.
1. Let _ns_ be ℝ(GetUTCEpochNanoseconds(_isoDateTime_.[[Year]], _isoDateTime_.[[Month]], _isoDateTime_.[[Day]], _isoDateTime_.[[Hour]], _isoDateTime_.[[Minute]], _isoDateTime_.[[Second]], _isoDateTime_.[[Millisecond]], _isoDateTime_.[[Microsecond]], _isoDateTime_.[[Nanosecond]])).
1. If _ns_ ≤ nsMinInstant - nsPerDay, then
1. Return *false*.
1. If _ns_ ≥ nsMaxInstant + nsPerDay, then
Expand Down Expand Up @@ -1003,7 +994,8 @@ <h1>
<emu-alg>
1. If IsValidISODate(_isoYear_, _isoMonth_, _isoDay_) is *false*, throw a *RangeError* exception.
1. If IsValidTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_) is *false*, throw a *RangeError* exception.
1. If ISODateTimeWithinLimits(_isoYear_, _isoMonth_, _isoDay_, _hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_) is *false*, then
1. Let _isoDateTime_ be ISO Date-Time Record { [[Year]]: _isoYear_, [[Month]]: _isoMonth_, [[Day]]: _isoDay_, [[Hour]]: _hour_, [[Minute]]: _minute_, [[Second]]: _second_, [[Millisecond]]: _millisecond_, [[Microsecond]]: _microsecond_, [[Nanosecond]]: _nanosecond_ }.
1. If ISODateTimeWithinLimits(_isoDateTime_) is *false*, then
1. Throw a *RangeError* exception.
1. If _newTarget_ is not present, set _newTarget_ to %Temporal.PlainDateTime%.
1. Let _object_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Temporal.PlainDateTime.prototype%"*, « [[InitializedTemporalDateTime]], [[ISOYear]], [[ISOMonth]], [[ISODay]], [[ISOHour]], [[ISOMinute]], [[ISOSecond]], [[ISOMillisecond]], [[ISOMicrosecond]], [[ISONanosecond]], [[Calendar]] »).
Expand Down Expand Up @@ -1114,7 +1106,8 @@ <h1>
</dl>
<emu-alg>
1. Assert: IsValidISODate(_year_, _month_, _day_) is *true*.
1. Assert: ISODateTimeWithinLimits(_year_, _month_, _day_, _hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_) is *true*.
1. Let _isoDateTime_ be ISO Date-Time Record { [[Year]]: _year_, [[Month]]: _month_, [[Day]]: _day_, [[Hour]]: _hour_, [[Minute]]: _minute_, [[Second]]: _second_, [[Millisecond]]: _millisecond_, [[Microsecond]]: _microsecond_, [[Nanosecond]]: _nanosecond_ }.
1. Assert: ISODateTimeWithinLimits(_isoDateTime_) is *true*.
1. Let _roundedTime_ be RoundTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_, _increment_, _unit_, _roundingMode_).
1. Let _balanceResult_ be BalanceISODate(_year_, _month_, _day_ + _roundedTime_.[[Days]]).
1. Return CombineISODateAndTimeRecord(_balanceResult_, _roundedTime_).
Expand Down Expand Up @@ -1154,8 +1147,10 @@ <h1>
</dd>
</dl>
<emu-alg>
1. Assert: ISODateTimeWithinLimits(_y1_, _mon1_, _d1_, _h1_, _min1_, _s1_, _ms1_, _mus1_, _ns1_) is *true*.
1. Assert: ISODateTimeWithinLimits(_y2_, _mon2_, _d2_, _h2_, _min2_, _s2_, _ms2_, _mus2_, _ns2_) is *true*.
1. Let _isoDateTime1_ be ISO Date-Time Record { [[Year]]: _y1_, [[Month]]: _mon1_, [[Day]]: _d1_, [[Hour]]: _h1_, [[Minute]]: _min1_, [[Second]]: _s1_, [[Millisecond]]: _ms1_, [[Microsecond]]: _mus1_, [[Nanosecond]]: _ns1_ }.
1. Assert: ISODateTimeWithinLimits(_isoDateTime1_) is *true*.
1. Let _isoDateTime2_ be ISO Date-Time Record { [[Year]]: _y2_, [[Month]]: _mon2_, [[Day]]: _d2_, [[Hour]]: _h2_, [[Minute]]: _min2_, [[Second]]: _s2_, [[Millisecond]]: _ms2_, [[Microsecond]]: _mus2_, [[Nanosecond]]: _ns2_ }.
1. Assert: ISODateTimeWithinLimits(_isoDateTime2_) is *true*.
1. Let _timeDuration_ be DifferenceTime(_h1_, _min1_, _s1_, _ms1_, _mus1_, _ns1_, _h2_, _min2_, _s2_, _ms2_, _mus2_, _ns2_).
1. Let _timeSign_ be NormalizedTimeDurationSign(_timeDuration_).
1. Let _dateSign_ be CompareISODate(_y2_, _mon2_, _d2_, _y1_, _mon1_, _d1_).
Expand Down
3 changes: 2 additions & 1 deletion spec/plainmonthday.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ <h1>
</dl>
<emu-alg>
1. If IsValidISODate(_referenceISOYear_, _isoMonth_, _isoDay_) is *false*, throw a *RangeError* exception.
1. If ISODateWithinLimits(_referenceISOYear_, _isoMonth_, _isoDay_) is *false*, throw a *RangeError* exception.
1. Let _isoDate_ be CreateISODateRecord(_referenceISOYear_, _isoMonth_, _isoDay_).
1. If ISODateWithinLimits(_isoDate_) is *false*, throw a *RangeError* exception.
1. If _newTarget_ is not present, set _newTarget_ to %Temporal.PlainMonthDay%.
1. Let _object_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Temporal.PlainMonthDay.prototype%"*, « [[InitializedTemporalMonthDay]], [[ISOMonth]], [[ISODay]], [[ISOYear]], [[Calendar]] »).
1. Set _object_.[[ISOMonth]] to _isoMonth_.
Expand Down
2 changes: 1 addition & 1 deletion spec/plainyearmonth.html
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ <h1>
1. Let _oneMonthDuration_ be ! CreateDateDurationRecord(0, 1, 0, 0).
1. Let _nextMonth_ be ? CalendarDateAdd(_calendar_, _intermediateDate_, _oneMonthDuration_, ~constrain~).
1. Let _date_ be BalanceISODate(_nextMonth_.[[Year]], _nextMonth_.[[Month]], _nextMonth_.[[Day]] - 1).
1. Assert: ISODateWithinLimits(_date_.[[Year]], _date_.[[Month]], _date_.[[Day]]) is *true*.
1. Assert: ISODateWithinLimits(_date_) is *true*.
1. Else,
1. Let _date_ be _intermediateDate_.
1. Let _durationToAdd_ be ? NormalizeDurationWithoutTime(_duration_).
Expand Down
Loading

0 comments on commit 7d3fe71

Please sign in to comment.