No successful run was found on main (9436f07) during the generation of this report, so af134fa was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.
fix(es/minifier): Prevent array destructuring optimization in assignment contexts
This fixes issue #11084 where the minifier incorrectly optimized array
expressions used as assignment targets in destructuring assignments,
causing them to be replaced with literal values.
Example of the bug:
```javascript
const bin = { hasMore: false, hasDisorder: false };
[bin.hasMore, bin.hasDisorder] = [true, true];
// Was incorrectly minified to: [!1, !1] = [!0, !0]
// Which produces: SyntaxError: Invalid destructuring assignment target
```
The fix adds a context check to `eval_array_spread()` to skip
optimization when the array is used:
- As the left-hand side of an assignment (IS_LHS_OF_ASSIGN)
- In a delete operation (IN_DELETE)
- As an argument to update operators like ++ or -- (IS_UPDATE_ARG)
This follows the same pattern used by other evaluation functions in the
codebase, such as `eval_array_method_call()`.
Closes #11084
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
4b368c8
8 days ago
by github-actions[bot]
0%
Fix test output formatting for issue #11084
Update the expected test output to match the actual formatting produced by the minifier. The fix is working correctly - it preserves assignment targets on the left-hand side of destructuring assignments and doesn't optimize them away. The only difference was in the code formatting (multi-line vs single-line array literals).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>