1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-16 07:42:25 +00:00
serenity/Userland/Libraries/LibJS/Runtime/Temporal
Daniel Bertalan 96b197ef46 LibJS/Temporal: Perform floating point arithmetic in RoundTime
The valid range for temporal values (`nsMinInstant`/`nsMaxInstant`)
means performing nanosecond-valued integers could lead to an overflow.

NB: Only the `roundingMode: "day"` case was affected, as all others were
already performing the division on floating-point `fractional_second`
values. I'm adding `.0` suffixes everywhere to make this fact clearer.

This adds a few local tests as well, as those are tested with sanitizers
enabled by default, unlike test262.
2023-07-01 06:51:25 +02:00
..
AbstractOperations.cpp
AbstractOperations.h
Calendar.cpp
Calendar.h
CalendarConstructor.cpp
CalendarConstructor.h
CalendarPrototype.cpp
CalendarPrototype.h
Duration.cpp
Duration.h
DurationConstructor.cpp
DurationConstructor.h
DurationPrototype.cpp
DurationPrototype.h
Instant.cpp
Instant.h
InstantConstructor.cpp
InstantConstructor.h
InstantPrototype.cpp
InstantPrototype.h
ISO8601.cpp
ISO8601.h
Now.cpp
Now.h
PlainDate.cpp
PlainDate.h
PlainDateConstructor.cpp
PlainDateConstructor.h
PlainDatePrototype.cpp
PlainDatePrototype.h
PlainDateTime.cpp
PlainDateTime.h
PlainDateTimeConstructor.cpp
PlainDateTimeConstructor.h
PlainDateTimePrototype.cpp
PlainDateTimePrototype.h
PlainMonthDay.cpp
PlainMonthDay.h
PlainMonthDayConstructor.cpp
PlainMonthDayConstructor.h
PlainMonthDayPrototype.cpp
PlainMonthDayPrototype.h
PlainTime.cpp
PlainTime.h
PlainTimeConstructor.cpp
PlainTimeConstructor.h
PlainTimePrototype.cpp
PlainTimePrototype.h
PlainYearMonth.cpp
PlainYearMonth.h
PlainYearMonthConstructor.cpp
PlainYearMonthConstructor.h
PlainYearMonthPrototype.cpp
PlainYearMonthPrototype.h
Temporal.cpp
Temporal.h
TimeZone.cpp
TimeZone.h
TimeZoneConstructor.cpp
TimeZoneConstructor.h
TimeZonePrototype.cpp
TimeZonePrototype.h
ZonedDateTime.cpp
ZonedDateTime.h
ZonedDateTimeConstructor.cpp
ZonedDateTimeConstructor.h
ZonedDateTimePrototype.cpp
ZonedDateTimePrototype.h