Skip to content

Commit

Permalink
Editorial: Return types for AOs that return Duration Records
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomato authored and Ms2ger committed Jun 21, 2023
1 parent 4c2fcaf commit 3bf0cfe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -1555,11 +1555,11 @@ <h1>
<h1>
ParseTemporalDurationString (
_isoString_: a String,
)
): either a normal completion containing a Duration Record, or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>It parses the argument as an ISO 8601 duration string and returns a Duration Record.</dd>
<dd>It parses the argument as an ISO 8601 duration string.</dd>
</dl>
<emu-note>The value of ToIntegerWithTruncation(*""*) is 0.</emu-note>
<emu-note>Use of mathematical values rather than approximations is important to avoid off-by-one errors with input like "PT46H66M71.50040904S".</emu-note>
Expand Down
12 changes: 6 additions & 6 deletions spec/duration.html
Original file line number Diff line number Diff line change
Expand Up @@ -805,11 +805,11 @@ <h1>
_milliseconds_: an integer,
_microseconds_: an integer,
_nanoseconds_: an integer,
)
): either a normal completion containing a Duration Record, or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>It returns a Duration Record.</dd>
<dd></dd>
</dl>
<emu-alg>
1. If ! IsValidDuration(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_) is *false*, throw a *RangeError* exception.
Expand Down Expand Up @@ -1562,11 +1562,11 @@ <h1>
_mus2_: an integer,
_ns2_: an integer,
_relativeTo_: *undefined*, a Temporal.PlainDate, or a Temporal.ZonedDateTime,
)
): either a normal completion containing a Duration Record, or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>It adds the components of a second duration represented by _y2_ through _ns2_ to those of a first duration represented by _y1_ through _ns1_, and balances the duration relative to the given date _relativeTo_, to ensure that no mixed signs remain in the result. The result is returned as a Duration Record.</dd>
<dd>It adds the components of a second duration represented by _y2_ through _ns2_ to those of a first duration represented by _y1_ through _ns1_, and balances the duration relative to the given date _relativeTo_, to ensure that no mixed signs remain in the result.</dd>
</dl>
<emu-alg>
1. Let _largestUnit1_ be ! DefaultTemporalLargestUnit(_y1_, _mon1_, _w1_, _d1_, _h1_, _min1_, _s1_, _ms1_, _mus1_).
Expand Down Expand Up @@ -1859,12 +1859,12 @@ <h1>
_unit_: a String,
_roundingMode_: a String,
_relativeTo_: *undefined*, a Temporal.PlainDate, or a Temporal.ZonedDateTime,
)
): either a normal completion containing a Duration Record, or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>
It adjusts, if necessary, a duration that was rounded to a unit of hours or lower relative to a Temporal.ZonedDateTime, and returns the result as a Duration Record.
It adjusts, if necessary, a duration that was rounded to a unit of hours or lower relative to a Temporal.ZonedDateTime, and returns the result.
On a calendar day that is not 24 hours in length due to time zone offset changes, it is possible for a duration's time units to round up to exceed the day's length.
In this case, the days part of the duration is adjusted by one, and the time part is re-rounded.
</dd>
Expand Down
4 changes: 2 additions & 2 deletions spec/plaindatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -1116,12 +1116,12 @@ <h1>
_calendar_: an Object,
_largestUnit_: a String,
_options_: an Object,
)
): either a normal completion containing a Duration Record, or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>
It returns a Duration Record with the elapsed duration from a first date and time, until a second date and time, according to the reckoning of the given _calendar_.
The returned Duration Record contains the elapsed duration from a first date and time, until a second date and time, according to the reckoning of the given _calendar_.
The given date and time units are all in the ISO 8601 calendar.
The _largestUnit_ and _options_ arguments are used in _calendar_'s `dateUntil` method.
</dd>
Expand Down

0 comments on commit 3bf0cfe

Please sign in to comment.