Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Introduce SystemUTCEpochMilliseconds to confine GetGlobalObject() #2603

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions spec/mainadditions.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,13 @@ <h1><a href="https://tc39.es/ecma262/#sec-date-constructor">The Date Constructor
<h1><a href="https://tc39.es/ecma262/#sec-date">Date ( ..._values_ )</a></h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. If NewTarget is *undefined*, then
1. <del>If NewTarget is *undefined*, then</del>
1. <del>Let _now_ be the time value (UTC) identifying the current time.</del>
1. <ins>Let _global_ be GetGlobalObject().</ins>
1. <ins>Let _nowNs_ be HostSystemUTCEpochNanoseconds(_global_).</ins>
1. <ins>Let _now_ be 𝔽(floor(_nowNs_ / 10<sup>6</sup>)).</ins>
1. Return ToDateString(_now_).
1. <del>Return ToDateString(_now_).</del>
1. <ins>If NewTarget is *undefined*, return ToDateString(SystemUTCEpochMilliseconds()).</ins>
1. Let _numberOfArgs_ be the number of elements in _values_.
1. If _numberOfArgs_ = 0, then
1. <del>Let _dv_ be the time value (UTC) identifying the current time.</del>
1. <ins>Let _global_ be GetGlobalObject().</ins>
1. <ins>Let _nowNs_ be HostSystemUTCEpochNanoseconds(_global_).</ins>
1. <ins>Let _dv_ be 𝔽(floor(_nowNs_ / 10<sup>6</sup>)).</ins>
1. Let _dv_ be <del>the time value (UTC) identifying the current time</del> <ins>SystemUTCEpochMilliseconds()</ins>.
1. Else if _numberOfArgs_ = 1, then
1. Let _value_ be _values_[0].
1. If _value_ is an Object and _value_ has a [[DateValue]] internal slot, then
Expand Down Expand Up @@ -276,9 +271,7 @@ <h1><a href="https://tc39.es/ecma262/#sec-date.now">Date.now ( )</a></h1>
<ins class="block">
<p>This function performs the following steps when called:</p>
<emu-alg>
1. Let _global_ be GetGlobalObject().
1. Let _nowNs_ be HostSystemUTCEpochNanoseconds(_global_).
1. Return 𝔽(floor(_nowNs_ / 10<sup>6</sup>)).
1. Return SystemUTCEpochMilliseconds().
</emu-alg>
</ins>
</emu-clause>
Expand Down
12 changes: 11 additions & 1 deletion spec/temporal.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,21 @@ <h1>
<p>ECMAScript hosts that are not web browsers must use the default implementation of HostSystemUTCEpochNanoseconds.</p>
</emu-clause>

<emu-clause id="sec-temporal-systemutcepochmilliseconds" aoid="SystemUTCEpochMilliseconds">
<h1>SystemUTCEpochMilliseconds ( )</h1>
<emu-alg>
1. Let _global_ be GetGlobalObject().
1. Let _nowNs_ be HostSystemUTCEpochNanoseconds(_global_).
1. Return 𝔽(floor(_nowNs_ / 10<sup>6</sup>)).
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-systemutcepochnanoseconds" aoid="SystemUTCEpochNanoseconds">
<h1>SystemUTCEpochNanoseconds ( )</h1>
<emu-alg>
1. Let _global_ be GetGlobalObject().
1. Return ℤ(HostSystemUTCEpochNanoseconds(_global_)).
1. Let _nowNs_ be HostSystemUTCEpochNanoseconds(_global_).
1. Return ℤ(_nowNs_).
</emu-alg>
</emu-clause>

Expand Down