ladybird/Libraries/LibJS/Rust
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
..
src LibJS: Materialize arguments object for shorthand { arguments } 2026-04-27 08:04:11 +02:00
build.rs Meta: Move python code generators to a subdirectory 2026-04-23 07:31:19 -04:00
Cargo.toml LibJS: Allocate local variable indices in source order 2026-04-27 08:04:11 +02:00
cbindgen.toml LibJS: Resolve VM constants during executable creation 2026-04-26 21:51:52 +02:00