1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00
serenity/Userland/Libraries/LibJS/Tests/builtins/Intl
Timothy Flynn 9e50f25ac4 LibJS: Prevent i64 overflow when computing large NumberFormat exponents
The largest exponents we compute are on the order of 10^21 (governed by
the maximumSignificantDigits option, which has a max value of 21). That
is too large to fit into the i64 we were using when multiplying this
exponent by the value to be formatted.

Instead, split up the logic to multiply that value by this exponent
based on the value's underlying type:

Number: Do not cast the result of pow() to an i64, and perform the
follow-up multiplication with doubles.

BigInt: Do not use pow(). Instead, compute the exponent as a BigInt
from the start, then perform the follow-up multiplication with that
BigInt.
2022-07-18 08:51:07 +01:00
..
Collator LibJS: Define the Intl.Collator's compare function name to be empty 2022-02-21 16:30:19 +00:00
DateTimeFormat LibJS: Allow specifying keyword values not directly defined for a locale 2022-07-15 12:31:43 +02:00
DisplayNames LibJS: Disallow calendar display names which contain an underscore 2022-03-30 14:24:32 +01:00
DurationFormat LibJS: Allow specifying keyword values not directly defined for a locale 2022-07-15 12:31:43 +02:00
ListFormat LibJS: Change wording of ErrorType::NotA to be independent of context 2021-09-12 00:16:39 +02:00
Locale LibJS: Implement Intl.Locale.prototype.weekInfo property 2022-07-06 16:56:42 +02:00
NumberFormat LibJS: Prevent i64 overflow when computing large NumberFormat exponents 2022-07-18 08:51:07 +01:00
PluralRules LibJS: Populate roundingPriority in Intl.PluralRules.resolvedOptions 2022-07-13 19:22:26 +01:00
RelativeTimeFormat LibJS: Allow specifying keyword values not directly defined for a locale 2022-07-15 12:31:43 +02:00
Segmenter LibJS: Implement Intl %SegmentIteratorPrototype%.next ( ) 2022-01-31 21:05:04 +02:00
Intl.@@toStringTag.js LibJS: Implement Intl[@@toStringTag] 2021-08-08 20:14:59 +01:00
Intl.getCanonicalLocales.js LibJS: Handle existing Intl.Locale objects in CanonicalizeLocaleList 2021-09-02 17:56:42 +01:00
Intl.supportedValuesOf.js LibJS: Implement Intl.supportedValuesOf 2022-01-31 00:32:41 +00:00