ladybird/Libraries/LibJS/Rust/src/bytecode
Andreas Kling e65e85cb8c LibJS: Materialize arguments object for shorthand { arguments }
The parser only set `might_need_arguments_object` when an `arguments`
or `eval` Identifier went through `consume()`, but shorthand object
properties create the reference via `make_identifier()` directly. As
a result `function f() { return { arguments } }` allocated an
`arguments` local, never initialized it, and crashed at runtime when
the property was read.

Fall back to scope-driven detection: if scope analysis allocated a
non-lexical `arguments` local for the function, treat it as a real
arguments-object reference and emit `CreateArguments`. Skip the
fallback when a function declaration named `arguments` claims the
local, since that local belongs to the function, not the arguments
object.

Add a runtime test covering shorthand inside a free function and a
method, plus a regression test for `({ eval } = ...)` to confirm
destructuring assignment doesn't accidentally trigger arguments
materialization.
2026-04-27 08:04:11 +02:00
..
basic_block.rs LibJS: Preserve source positions in bytecode source maps 2026-04-22 22:34:54 +02:00
codegen.rs LibJS: Materialize arguments object for shorthand { arguments } 2026-04-27 08:04:11 +02:00
ffi.rs LibJS: Precompile top-level IIFEs off-thread 2026-04-26 21:51:52 +02:00
generator.rs LibJS: Precompile top-level IIFEs off-thread 2026-04-26 21:51:52 +02:00
instruction.rs LibJS: Add alternative source-to-bytecode pipeline in Rust 2026-02-24 09:39:42 +01:00
mod.rs LibJS: Add alternative source-to-bytecode pipeline in Rust 2026-02-24 09:39:42 +01:00
operand.rs Rust: Add a config file for rustfmt 2026-04-18 08:05:47 -04:00