mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
LibJS: Replace magic nanosecond numbers with constants
This is an editorial change in the Temporal spec.
See: 3fdbfda
This commit is contained in:
parent
3729a910f6
commit
c6f7214a60
9 changed files with 45 additions and 36 deletions
|
@ -164,7 +164,7 @@ BigInt* system_utc_epoch_nanoseconds(GlobalObject& global_object)
|
|||
auto now = Time::now_realtime().to_nanoseconds();
|
||||
auto ns = Crypto::SignedBigInteger::create_from(now);
|
||||
|
||||
// 2. Set ns to the result of clamping ns between -8.64 × 10^21 and 8.64 × 10^21.
|
||||
// 2. Set ns to the result of clamping ns between nsMinInstant and nsMaxInstant.
|
||||
// NOTE: Time::to_nanoseconds() already clamps between -(2^63) and 2^63 - 1, the range of an i64,
|
||||
// if an overflow occurs during seconds -> nanoseconds conversion.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue