Skip to content

Lower private names referenced by class static blocks during decorator lowering - #31405

Closed
robobun wants to merge 9 commits into
mainfrom
farm/5d9e5c46/decorator-static-block-private
Closed

robobun wants to merge 9 commits into
mainfrom
farm/5d9e5c46/decorator-static-block-private

Scope static-init private tracking to the class being visited

bf086da
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 26, 2026 in 35m 31s

Code review found 1 potential issue

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

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/js_parser/visit/mod.rs:1219-1232 Per-class static_init_private_refs filter drops outer-private refs when nested class is inside outer's static block

Annotations

Check notice on line 1232 in src/js_parser/visit/mod.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Per-class static_init_private_refs filter drops outer-private refs when nested class is inside outer's static block

🟣 Pre-existing, in scope: this filter only re-inserts refs that match *this* class's own private keys, so when an inner class nested inside an *outer class's static block* records an outer private (e.g. `#o`) from its own `static {}`, the ref is dropped here and never reaches Outer's pre-scan. Repro still unparseable: `class Outer { #o() {} accessor a = 1; static { class Inner { accessor b = 1; static { console.log(#o in new Outer()); } } } }` — Outer keeps `#o` native and its extracted static b