1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00
serenity/Userland/Libraries/LibJS/Tests
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
..
builtins LibJS: Prevent i64 overflow when computing large NumberFormat exponents 2022-07-18 08:51:07 +01:00
classes LibJS: Add tests for the new steps added to PerformEval 2022-04-11 21:23:36 +01:00
functions LibJS: Add tests for the new steps added to PerformEval 2022-04-11 21:23:36 +01:00
iterators LibJS: Disallow duplicated variable declarations 2021-07-20 23:45:28 +02:00
loops LibJS: Bring ForIn body evaluation closer to the specification 2022-03-29 14:34:08 +03:00
modules LibJS: Infer file extensions when resolving module paths 2022-06-26 22:03:53 +01:00
operators LibJS: Add more delete operator tests 2022-03-28 14:05:33 +02:00
syntax LibJS: Fix mixing of logical and coalescing operators 2022-02-16 11:18:41 +00:00
add-values-to-primitive.js
arguments-callee.js
arguments-object.js
automatic-semicolon-insertion.js LibJS/Tests: Use eval() for toEvalTo(), not Function() 2021-06-18 20:35:23 +01:00
break-continue-syntax-errors.js
comments-basic.js LibJS: Make new lines in block comments reset line has token 2021-12-21 14:04:23 +01:00
computed-property-sideeffects.js LibJS: Ensure we only call toString on computed properties once 2022-02-18 22:33:59 +00:00
computed-property-throws.js
const-declaration-missing-initializer.js
const-reassignment.js
custom-@@hasInstance.js LibJS: Rewrite most of Object for spec compliance :^) 2021-07-04 22:07:36 +01:00
custom-@@toPrimitive.js
custom-@@toStringTag.js
debugger-statement.js
duplicated-variable-declarations.js LibJS: Enable now working tests for duplicated variable declarations 2021-10-15 10:27:16 +01:00
empty-statements.js
eval-aliasing.js LibJS: Correct behaviour of direct vs. indirect eval 2021-06-23 09:38:33 +01:00
eval-basic.js LibJS: Correct behaviour of direct vs. indirect eval 2021-06-23 09:38:33 +01:00
exception-in-catch-block.js
exception-ReferenceError.js
exponentiation-basic.js LibJS: Unify exponentiation logic for ** operator and Math.pow 2022-02-18 22:31:36 +00:00
global-var-let-const.js LibJS: Only "var" declarations go in the global object at program level 2021-06-09 23:25:16 +02:00
if-statement-function-declaration.js
indexed-access-prototype-indirection.js
indexed-access-string-object.js
invalid-lhs-in-assignment.js
labels.js LibJS: Replace the custom unwind mechanism with completions :^) 2022-01-06 12:36:23 +01:00
let-scoping.js
new-expression.js
non-writable-assignment.js LibJS: Throw TypeError on write to non-writable property in strict mode 2021-06-05 23:54:08 +01:00
numeric-literals-basic.js
object-basic.js LibJS: Disallow shorthand properties with reserved names 2021-11-30 17:05:32 +00:00
object-expression-__proto__.js LibJS: Implement the object literal __proto__ property key special case 2022-03-06 01:38:25 +02:00
object-expression-computed-property.js
object-expression-numeric-property.js LibJS: Don't treat 2^32 - 1 as numeric PropertyName 2021-07-06 17:29:12 +01:00
object-getter-setter-shorthand.js
object-method-shorthand.js
object-spread.js LibJS: Use CopyDataProperties when spreading in object expressions 2022-02-15 00:51:25 +00:00
ordinary-to-primitive.js
parseInt.js LibJS: Uncomment and add parseInt tests 2021-06-06 01:34:22 +01:00
parser-declaration-in-single-statement-context.js
parser-line-terminators.js LibJS: Implement create_dynamic_function() according to the spec 2022-01-16 01:54:48 +01:00
parser-unary-associativity.js
permanently-screwed-by-eval.js LibJS: Fast non-local variable access :^) 2021-10-07 11:53:18 +02:00
program-non-strict.js LibJS: Add tests for strict mode and strict mode propagation 2021-07-20 23:45:28 +02:00
program-strict-mode.js LibJS: Add tests for strict mode and strict mode propagation 2021-07-20 23:45:28 +02:00
return.js LibJS: Add tests for the new steps added to PerformEval 2022-04-11 21:23:36 +01:00
runtime-error-call-stack-size.js LibJS: Throw InternalErrors instead of Errors on CallStackSizeExceeded 2021-11-27 01:58:05 +02:00
statement-with-many-labels.js LibJS: Allow statements to have multiple labels 2021-09-26 18:24:19 +02:00
strict-mode-blocks.js
strict-mode-errors.js LibJS: Make scoping follow the spec 2021-09-30 08:16:32 +01:00
string-basic.js LibJS/Tests: Rename snake_case identifiers in string-basic.js 2022-02-13 14:33:46 +00:00
string-concatenation.js LibJS: Combine UTF-16 surrogate pairs when concatenating strings 2022-01-18 00:49:16 +00:00
string-escapes.js LibJS: Disallow '\8' and '\9' in strict mode due to being octal escapes 2021-11-30 17:05:32 +00:00
string-spread.js
switch-basic.js LibJS: Fix switch skipping case evaluation when hitting the default case 2021-09-30 08:16:32 +01:00
switch-break.js
switch-default-before-case.js LibJS: Defer execution of switch default clause until after case clauses 2021-09-26 18:04:25 +02:00
tagged-template-literals.js
template-literals.js
test-common-tests.js LibJS/Tests: Use eval() for toEvalTo(), not Function() 2021-06-18 20:35:23 +01:00
test-common.js LibJS: Allow 'expect().fail("some random string")' in test-js 2022-03-20 10:44:32 +03:30
this-value-strict.js LibJS/Tests: Enable two more skipped tests which now pass 2021-12-08 20:08:26 +00:00
this-value.js LibJS/Tests: Enable two more skipped tests which now pass 2021-12-08 20:08:26 +00:00
throw-basic.js
to-number-basic.js
to-number-exception.js
try-catch-finally-nested.js
try-catch-finally-return.js
try-catch-finally.js
unicode-identifier-escape.js LibJS: Fix some small remaining issues with parsing unicode escapes 2021-08-24 07:42:37 +01:00
update-expression-on-member-expression.js
update-expressions-basic.js
use-strict-directive.js
var-multiple-declarator.js
var-scoping.js LibJS: Enable now working tests for duplicated variable declarations 2021-10-15 10:27:16 +01:00
variable-undefined.js
with-basic.js LibJS: Restore the environment if an exception is thrown in 'with' block 2021-09-08 20:37:39 +01:00