ladybird/Libraries/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
..
Bytecode LibJS: Fix export default of parenthesized named class expression 2026-02-21 19:27:03 +01:00
Contrib/Test262 LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16 2025-08-05 07:07:15 -04:00
Heap LibJS: Mark JS::Cell::initialize() as MUST_UPCALL 2026-02-06 13:50:54 +01:00
Runtime LibJS: Handle power-of-10 boundaries in Number.toExponential/toPrecision 2026-02-22 09:39:10 -05:00
AST.cpp LibJS: Make MemberExpression::to_string_approximation() recursive 2026-02-15 23:21:46 +01:00
AST.h LibJS: Make bytecode generation infallible 2026-02-12 11:37:43 +01:00
ASTDump.cpp LibJS: Redesign AST dump with unicode tree drawing 2026-02-10 02:05:20 +01:00
CMakeLists.txt LibJS: Make bytecode generation infallible 2026-02-12 11:37:43 +01:00
Console.cpp LibJS: Add source locations to console.trace() 2026-02-06 11:58:07 +00:00
Console.h LibJS: Add source locations to console.trace() 2026-02-06 11:58:07 +00:00
CyclicModule.cpp LibJS: Align async module rejection order with fulfillment order 2025-12-17 15:33:26 +01:00
CyclicModule.h LibJS: Sync additional Import Attributes spec changes 2025-10-22 10:58:19 +02:00
Forward.h LibWeb: Reduce recompilation impact of DOM/Document.h 2026-02-11 20:02:28 +01:00
FunctionParsingInsights.h LibJS: Remove #include <AST.h> from SharedFunctionInstanceData.h 2026-02-11 23:57:41 +01:00
Lexer.cpp LibJS: Cache length-in-code-units in SourceCode 2025-11-09 12:14:03 +01:00
Lexer.h LibJS: Cache an Utf16View for the full code string in SourceCode 2025-11-09 12:14:03 +01:00
LocalVariable.h LibJS: Port the Identifier AST (and related) nodes to UTF-16 2025-08-13 09:56:13 -04:00
Module.cpp LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
Module.h LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
ModuleLoading.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Parser.cpp LibJS: Fix export default of parenthesized named class expression 2026-02-21 19:27:03 +01:00
Parser.h LibJS: Move labels_in_scope out of ParserState 2026-02-10 02:05:20 +01:00
ParserError.cpp LibJS: Port the JS lexer and parser to UTF-16 2025-08-13 09:56:13 -04:00
ParserError.h LibJS: Port the JS lexer and parser to UTF-16 2025-08-13 09:56:13 -04:00
Position.h LibJS: Store full realized SourceRange with each AST node 2025-12-29 13:36:01 +01:00
Print.cpp LibJS: Work around inconsistency in CLDR Temporal data sources 2026-02-14 19:47:29 +01:00
Print.h LibJS: Enable EXPLICIT_SYMBOL_EXPORT and annotate minimum symbol set 2025-07-22 11:51:29 -04:00
ScopeCollector.cpp LibJS: Propagate captures from nested functions in default expressions 2026-02-19 02:45:37 +01:00
ScopeCollector.h LibJS: Replace ScopePusher with ScopeCollector 2026-02-10 02:05:20 +01:00
ScopeRecord.h LibJS: Don't optimize body vars to locals when referenced in defaults 2026-02-19 02:45:37 +01:00
Script.cpp LibJS: Move SharedFunctionInstanceData creation out of FunctionNode 2026-02-11 23:57:41 +01:00
Script.h LibJS: Drop AST after first compilation on Script 2026-02-11 23:57:41 +01:00
SourceCode.cpp LibJS: Store full realized SourceRange with each AST node 2025-12-29 13:36:01 +01:00
SourceCode.h LibJS: Cache length-in-code-units in SourceCode 2025-11-09 12:14:03 +01:00
SourceRange.h AK: Remove unused include from ByteString 2026-02-17 12:38:51 +00:00
SourceTextModule.cpp LibJS: Make bytecode generation infallible 2026-02-12 11:37:43 +01:00
SourceTextModule.h LibJS: Drop AST after first compilation on SourceTextModule 2026-02-11 23:57:41 +01:00
SyntaxHighlighter.cpp LibJS: Have JS::Lexer take a JS::SourceCode as input 2025-11-09 12:14:03 +01:00
SyntaxHighlighter.h LibJS: Enable EXPLICIT_SYMBOL_EXPORT and annotate minimum symbol set 2025-07-22 11:51:29 -04:00
SyntheticModule.cpp LibJS: Skip initializing constant slots in ExecutionContext 2026-01-19 10:48:12 +01:00
SyntheticModule.h LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16 2025-08-05 07:07:15 -04:00
Token.cpp LibJS: Parse overflowing integer literals correctly 2026-02-19 02:45:37 +01:00
Token.h LibJS: Store full realized SourceRange with each AST node 2025-12-29 13:36:01 +01:00