Files
ladybird/Libraries/LibJS
Andreas Kling 3efd1a1bb5 LibJS: Reject duplicate params across destructuring patterns in C++
The C++ parser was not rejecting duplicate parameter names across
destructuring patterns in non-simple parameter lists. For example,
`function f({ bar, ...a }, { bar, ...b }) {}` was accepted despite
being a syntax error per spec.

The existing inline duplicate check only ran for identifier parameters,
missing the case where both parameters are binding patterns. Add a
post-parse pass that collects all bound names and checks for duplicates
when the parameter list is non-simple (or in strict mode/arrows).

Also fix existing tests that relied on the incorrect behavior and add
new test coverage for destructuring duplicate detection.
2026-03-19 09:43:11 +01:00
..