1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:07:34 +00:00
serenity/Userland/Libraries/LibJS/Tests/builtins
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
..
AggregateError LibJS: Implement the Error Cause proposal 2021-06-11 21:34:05 +01:00
Array LibJS/Tests: Disable one Array.prototype.toSpliced test for now 2022-07-04 18:50:35 +02:00
ArrayBuffer LibJS: Revert partial resizable ArrayBuffer implementation 2022-07-06 15:52:57 +02:00
Atomics LibJS: Implement Atomics.isLockFree 2021-07-14 22:13:15 +01:00
BigInt LibJS: Implement BigInt.asUintN 2022-02-06 15:49:54 +00:00
Boolean LibJS: Change wording of ErrorType::NotA to be independent of context 2021-09-12 00:16:39 +02:00
DataView LibJS: Check for add overflow in DataViewConstructor 2022-06-27 20:51:00 +01:00
Date LibJS: Reject -00000 as extended year in Date parsing 2022-04-30 21:36:27 +02:00
Error LibJS: Relax line and column number restrictions in Error stack tests 2022-03-16 18:55:55 +00:00
FinalizationRegistry LibJS: Implement stage 3 proposal FinalizationRegistry changes 2022-06-23 10:57:52 +03:00
Function LibJS: Add [[InitialName]] and use it in Function.prototype.toString() 2022-02-20 23:21:40 +00:00
functions LibJS: Correcly handle surrogates in escape() 2022-01-14 10:59:46 +01:00
Infinity Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Intl LibJS: Prevent i64 overflow when computing large NumberFormat exponents 2022-07-18 08:51:07 +01:00
JSON AK: Treat empty string as invalid JSON 2022-07-10 23:31:48 +02:00
Map LibJS: Normalize NaN values in Sets and Maps 2022-04-02 14:15:43 +01:00
Math LibJS: Correctly handle mixing +0 and -0 in Math.{min,max}() 2021-04-23 20:51:48 +02:00
NaN Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Number LibJS: Fix rounding issues in Number.toFixed 2022-03-02 08:34:04 +01:00
Object Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
Promise LibJS: Don't coerce this value to object in Promise.prototype.finally() 2021-11-14 15:27:46 +00:00
Proxy LibJS: Throw InternalErrors instead of Errors on CallStackSizeExceeded 2021-11-27 01:58:05 +02:00
Reflect LibJS: Implement [[Call]] and [[Construct]] internal slots properly 2021-10-09 14:29:20 +01:00
RegExp LibJS: Create the RegExpExec result's "input" field last 2021-11-08 01:36:29 +01:00
Set LibJS: Normalize NaN values in Sets and Maps 2022-04-02 14:15:43 +01:00
ShadowRealm LibJS: Check type of ShadowRealm.prototype.importValue() 2nd argument 2022-03-29 23:48:25 +01:00
String LibJS: Stub out String.prototype.normalize 2022-06-02 23:04:27 +01:00
Symbol LibJS: Rename OrdinaryFunctionObject to ECMAScriptFunctionObject 2021-09-25 17:51:30 +02:00
Temporal LibJS: Fix production for time zone name in time zone strings 2022-06-29 07:35:42 +01:00
TypedArray LibJS: Add test case for %TypedArray%.prototype.toSpliced 2022-07-12 00:44:34 +01:00
WeakMap LibJS: Implement WeakMap changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00
WeakRef LibJS: Implement WeakRef changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00
WeakSet LibJS: Implement WeakSet changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00