ladybird/Tests/LibJS
Andreas Kling be5320b67c LibJS: Evaluate ToNumber for out-of-bounds typed array writes
The interpreter's fast path for PutByValue on a typed array treated an
out-of-bounds index as a silent no-op and returned without touching the
value. That is observably wrong: TypedArraySetElement evaluates
ToNumber(value) before checking the index, so a value with a valueOf
side effect must still have that side effect run even when the store is
ultimately discarded.

Fall back to the slow path on an out-of-bounds or otherwise invalid
index instead of reporting success. The slow path runs the full
TypedArraySetElement algorithm, which performs the coercion and then
discards the write. Direct assignment now matches Reflect.set, which
already went through the slow path.

Fixes the staging/sm typed array out-of-bounds ToNumber test262 case
and adds a test-js regression covering direct assignment, Reflect.set,
and Reflect.defineProperty.
2026-06-17 21:24:33 +02:00
..
AST LibJS: Fix destructured primitive string const loops 2026-05-22 01:56:57 +02:00
Bytecode LibJS: Preserve strict unresolvable assignment references 2026-05-22 14:30:35 +02:00
Runtime LibJS: Evaluate ToNumber for out-of-bounds typed array writes 2026-06-17 21:24:33 +02:00
CMakeLists.txt LibJS: Materialize decoded bytecode cache blobs 2026-05-06 08:20:06 +02:00
test-bytecode-cache.cpp LibWeb+LibJS: Cache decoded JS bytecode sidecars 2026-06-06 09:15:09 +02: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: Cache entry modules before loading imports 2026-05-22 01:56:57 +02:00
test-primitive-string.cpp Tests/LibJS: Remove unneeded GC::Root use in PrimitiveString test 2026-05-29 17:21:17 +02:00
test-value-js.cpp LibJS: Make Value() default-construct the undefined value 2025-04-05 11:20:26 +02:00