Skip to content

Commit

Permalink
Editorial: Inline SystemInstant and SystemZonedDateTime
Browse files Browse the repository at this point in the history
This fits with the general theme of returning Records instead of Objects,
but also these operations were each only called from one place. So inline
them.

See: #2949
  • Loading branch information
ptomato authored and Ms2ger committed Oct 8, 2024
1 parent 1eb5ab7 commit e76e417
Showing 1 changed file with 8 additions and 34 deletions.
42 changes: 8 additions & 34 deletions spec/temporal.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ <h1>Temporal.Now.timeZoneId ( )</h1>
<h1>Temporal.Now.instant ( )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. Return SystemInstant().
1. Let _ns_ be SystemUTCEpochNanoseconds().
1. Return ! CreateTemporalInstant(_ns_).
</emu-alg>
</emu-clause>

Expand All @@ -131,7 +132,12 @@ <h1>Temporal.Now.plainDateTimeISO ( [ _temporalTimeZoneLike_ ] )</h1>
<h1>Temporal.Now.zonedDateTimeISO ( [ _temporalTimeZoneLike_ ] )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. Return ? SystemZonedDateTime(_temporalTimeZoneLike_).
1. If _temporalTimeZoneLike_ is *undefined*, then
1. Let _timeZone_ be SystemTimeZoneIdentifier().
1. Else,
1. Let _timeZone_ be ? ToTemporalTimeZoneIdentifier(_temporalTimeZoneLike_).
1. Let _ns_ be SystemUTCEpochNanoseconds().
1. Return ! CreateTemporalZonedDateTime(_ns_, _timeZone_, *"iso8601"*).
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -215,18 +221,6 @@ <h1>SystemUTCEpochNanoseconds ( ): a BigInt</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-systeminstant" type="abstract operation">
<h1>SystemInstant ( ): a Temporal.Instant</h1>
<dl class="header">
<dt>description</dt>
<dd></dd>
</dl>
<emu-alg>
1. Let _ns_ be SystemUTCEpochNanoseconds().
1. Return ! CreateTemporalInstant(_ns_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-systemdatetime" type="abstract operation">
<h1>
SystemDateTime (
Expand All @@ -246,25 +240,5 @@ <h1>
1. Return GetISODateTimeFor(_timeZone_, _epochNs_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-systemzoneddatetime" type="abstract operation">
<h1>
SystemZonedDateTime (
_temporalTimeZoneLike_: an ECMAScript language value,
): either a normal completion containing a Temporal.ZonedDateTime or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd></dd>
</dl>
<emu-alg>
1. If _temporalTimeZoneLike_ is *undefined*, then
1. Let _timeZone_ be SystemTimeZoneIdentifier().
1. Else,
1. Let _timeZone_ be ? ToTemporalTimeZoneIdentifier(_temporalTimeZoneLike_).
1. Let _ns_ be SystemUTCEpochNanoseconds().
1. Return ! CreateTemporalZonedDateTime(_ns_, _timeZone_, *"iso8601"*).
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>

0 comments on commit e76e417

Please sign in to comment.