transpiler: preserve TDZ for top-level class declarations referenced earlier in the file - #34933
Open
robobun wants to merge 6 commits into
Open
transpiler: preserve TDZ for top-level class declarations referenced earlier in the file#34933robobun wants to merge 6 commits into
robobun wants to merge 6 commits into
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
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
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
Loading