ladybird/Tests/LibJS
Timothy Flynn 451ac7d5d2 LibJS: Handle power-of-10 boundaries in Number.toExponential/toPrecision
When the computed significand lands exactly on 10 ^ (precision - 1), the
value sits right on a power-of-10 boundary where two representations are
possible. For example, consider 1e-21. The nearest double value to 1e-21
is actually slightly less than 1e-21. So with `toPrecision(16)`, we must
choose between:

    exponent=-21 significand=1000000000000000 -> 1.000000000000000e-21
    exponent=-22 significand=9999999999999999 -> 9.999999999999999e-22

The spec dictates that we must pick the value that is closer to the true
value. In this case, the second value is actually closer.
2026-02-22 09:39:10 -05:00
..
AST AK+Everywhere: Use MurmurHash3 for int/u64 hashing 2026-02-20 22:47:24 +01:00
Bytecode LibJS: Don't reset switch case completion value for empty results 2026-02-19 12:02:50 +01:00
Runtime LibJS: Handle power-of-10 boundaries in Number.toExponential/toPrecision 2026-02-22 09:39:10 -05:00
CMakeLists.txt Tests/LibJS: Disable test-js-bytecode and test-js-ast on Windows 2026-02-10 02:05:20 +01:00
test-js-ast.py LibJS: Support .mjs files in test-js-ast and test-js-bytecode 2026-02-19 12:02:50 +01:00
test-js-bytecode.py LibJS: Support .mjs files in test-js-ast and test-js-bytecode 2026-02-19 12:02:50 +01:00
test-js.cpp LibJS: Move tests to /Tests/LibJS 2026-01-22 07:46:48 -05:00
test-value-js.cpp LibJS: Make Value() default-construct the undefined value 2025-04-05 11:20:26 +02:00