diff options
author | Linus Groh <mail@linusgroh.de> | 2022-03-18 22:53:36 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-03-19 19:28:49 +0000 |
commit | 48856498f0c518be20307c0a28637162dd97a398 (patch) | |
tree | a5f3fabe3a59af9925fe8c93ec63c4bc1f5a8041 /Userland/Libraries/LibJS/Runtime/Temporal/Duration.h | |
parent | 213df97b55f83889e405f84b294a1c754be4b184 (diff) | |
download | serenity-48856498f0c518be20307c0a28637162dd97a398.zip |
LibJS: Change total_duration_nanoseconds() from JS to Crypto BigInts
This removes a bunch of silly wrapping and unwrapping of Crypto
SignedBigInteger values in JS BigInt objects, which isn't even intended
by the spec - it just wants us to take an integer value, not a BigInt
specifically. Nice opportunity to remove a couple of allocations. :^)
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/Duration.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/Duration.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h index b10ee57441..105fa062da 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h @@ -148,7 +148,7 @@ ThrowCompletionOr<PartialDurationRecord> to_partial_duration(GlobalObject&, Valu ThrowCompletionOr<Duration*> create_temporal_duration(GlobalObject&, double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds, FunctionObject const* new_target = nullptr); Duration* create_negated_temporal_duration(GlobalObject& global_object, Duration const& duration); ThrowCompletionOr<double> calculate_offset_shift(GlobalObject&, Value relative_to_value, double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds); -BigInt* total_duration_nanoseconds(GlobalObject&, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, BigInt const& nanoseconds, double offset_shift); +Crypto::SignedBigInteger total_duration_nanoseconds(double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, Crypto::SignedBigInteger const& nanoseconds, double offset_shift); ThrowCompletionOr<TimeDurationRecord> balance_duration(GlobalObject&, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, BigInt const& nanoseconds, String const& largest_unit, Object* relative_to = nullptr); ThrowCompletionOr<DateDurationRecord> unbalance_duration_relative(GlobalObject&, double years, double months, double weeks, double days, String const& largest_unit, Value relative_to); ThrowCompletionOr<DateDurationRecord> balance_duration_relative(GlobalObject&, double years, double months, double weeks, double days, String const& largest_unit, Value relative_to); |