Skip to content

bundler: hoist object/array --define values to a shared var - #35958

Open
robobun wants to merge 11 commits into
mainfrom
farm/6f67858c/hoist-object-define
Open

bundler: hoist object/array --define values to a shared var#35958
robobun wants to merge 11 commits into
mainfrom
farm/6f67858c/hoist-object-define

[autofix.ci] apply automated fixes

f89e305
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 26, 2026 in 22m 49s

Code review found 1 important issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/js_parser/visit/visit_expr.rs:1221-1231 delete on bare-identifier object define emits strict-mode SyntaxError

Annotations

Check failure on line 1231 in src/js_parser/visit/visit_expr.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

delete on bare-identifier object define emits strict-mode SyntaxError

The `!id_before` guard misses the case where the operand was *already* an `EIdentifier` that gets substituted with the hoisted define ref: sloppy input `delete CFG;` with `--define 'CFG={"k":1}'` now emits `delete define_CFG_default` (strict-mode SyntaxError in ESM output; `false` instead of `true` in sloppy output) instead of the previous `delete { k: 1 }`. `p.delete_target` is never set by this arm, so the `!is_delete_target` guard at the identifier visit (`visit_expr.rs:263`) does not block t