Exit unsettled top-level await instead of hanging / busy-looping#29549
Closed
robobun wants to merge 33 commits into
Closed
Exit unsettled top-level await instead of hanging / busy-looping#29549robobun wants to merge 33 commits into
robobun wants to merge 33 commits into
Claude / Claude Code Review
completed
May 5, 2026 in 35m 58s
Code review found 2 potential issues
Found 4 candidates, confirmed 2. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 2 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/jsc/VirtualMachine.zig:959 |
Non-watcher path: TLA continuation that throws inside onBeforeExit drain is silently swallowed (exit 0) |
| 🟡 Nit | src/jsc/event_loop.zig:591 |
Hardcoded cross-file line number 'hot_reloader.zig:278' in doc-comment will drift |
Annotations
Check warning on line 959 in src/jsc/VirtualMachine.zig
claude / Claude Code Review
Non-watcher path: TLA continuation that throws inside onBeforeExit drain is silently swallowed (exit 0)
nit: sibling to the resolved comment at event_loop.zig:700 (the *resolve* case, fixed by 207afb3) — if a `process.on('beforeExit', …)` handler resolves an abandoned TLA whose continuation then *throws* (e.g. `const r = await later; throw new Error('boom')`), this drain settles the module `JSInternalPromise` to `.rejected` and nothing reports it: the non-watcher path's only reporter (bun.js.zig:402-425) already ran while the promise was `.pending`, `JSInternalPromise` rejections don't flow throug
Check warning on line 591 in src/jsc/event_loop.zig
claude / Claude Code Review
Hardcoded cross-file line number 'hot_reloader.zig:278' in doc-comment will drift
nit: the doc-comment on `hasAnyHandleWork()` references "the hot-reloader watcher at `hot_reloader.zig:278`" — a hardcoded cross-file line number that will drift on any edit above that line. This is the same drift hazard you already accepted and fixed in this PR for the "line 720" reference in VirtualMachine.zig (commit 93e2313). For consistency, replace with a stable symbolic reference like "in `HotReloader.Task.enqueue()`".
Loading