Skip to content

transpiler: preserve TDZ for top-level class declarations referenced earlier in the file - #34933

Open
robobun wants to merge 6 commits into
mainfrom
farm/a34e0399/class-decl-tdz-preserve
Open

transpiler: preserve TDZ for top-level class declarations referenced earlier in the file#34933
robobun wants to merge 6 commits into
mainfrom
farm/a34e0399/class-decl-tdz-preserve

move tests to a dedicated file; pin function-body-mention behaviour

a509074
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 21, 2026 in 14m 15s

Code review found 2 potential issues

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

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit test/bundler/transpiler/runtime-transpiler-class-hoist.test.ts:63-71 Order assertion can pass vacuously when a search token is absent
🟡 Nit test/bundler/transpiler/runtime-transpiler-class-hoist.test.ts:34-38 Subprocess-spawning tests dropped .concurrent when moved to new file

Annotations

Check warning on line 71 in test/bundler/transpiler/runtime-transpiler-class-hoist.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Order assertion can pass vacuously when a search token is absent

The order check maps each token to `stdout.indexOf(s)`, which returns `-1` for a missing token; because `Array#sort` is stable, a missing `"class A"` (or all four tokens) sorts to the front in original order and the assertion still passes — yet `class A` being first is exactly the property this test exists to prove. A one-line guard closes it: assert every index is `>= 0` before sorting, or fold the raw indices into the `toEqual` object so a `-1` shows up in the diff.

Check warning on line 38 in test/bundler/transpiler/runtime-transpiler-class-hoist.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Subprocess-spawning tests dropped .concurrent when moved to new file

The earlier revision in `runtime-transpiler.test.ts` used `test.concurrent.each` / `test.concurrent` for these tests, but the move to a dedicated file in a509074b dropped the `.concurrent` — line 34 is now plain `test.each` and lines 45/54 are plain `test`. All five tests spawn an independent subprocess with its own `tempDir` and share no state, so per test/CLAUDE.md:22 and REVIEW.md's harness-conventions bullet ("`test.concurrent` for independent subprocess suites") they should run concurrently