mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:57:45 +00:00
LibJS: Fix balance_time() for times with negative offset day outcome
...and change the parameter types from i64 to double, as predicted by a FIXME. The issue here is that integer division with a negative dividend doesn't yield the same result as floating point division wrapped in floor(). Additionally, the `days` variable needs to be signed.
This commit is contained in:
parent
32c52e3511
commit
42071f69cf
2 changed files with 21 additions and 22 deletions
|
@ -98,7 +98,7 @@ ThrowCompletionOr<PlainTime*> to_temporal_time(GlobalObject&, Value item, Option
|
|||
ThrowCompletionOr<PartialUnregulatedTemporalTime> to_partial_time(GlobalObject&, Object& temporal_time_like);
|
||||
ThrowCompletionOr<TemporalTime> regulate_time(GlobalObject&, double hour, double minute, double second, double millisecond, double microsecond, double nanosecond, StringView overflow);
|
||||
bool is_valid_time(double hour, double minute, double second, double millisecond, double microsecond, double nanosecond);
|
||||
DaysAndTime balance_time(i64 hour, i64 minute, i64 second, i64 millisecond, i64 microsecond, i64 nanosecond);
|
||||
DaysAndTime balance_time(double hour, double minute, double second, double millisecond, double microsecond, double nanosecond);
|
||||
TemporalTime constrain_time(double hour, double minute, double second, double millisecond, double microsecond, double nanosecond);
|
||||
ThrowCompletionOr<PlainTime*> create_temporal_time(GlobalObject&, u8 hour, u8 minute, u8 second, u16 millisecond, u16 microsecond, u16 nanosecond, FunctionObject const* new_target = nullptr);
|
||||
ThrowCompletionOr<UnregulatedTemporalTime> to_temporal_time_record(GlobalObject&, Object const& temporal_time_like);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue