event loop: run the timers phase before the entry point's queued work - #33509
Open
robobun wants to merge 13 commits into
Open
event loop: run the timers phase before the entry point's queued work#33509robobun wants to merge 13 commits into
robobun wants to merge 13 commits into
Claude / Claude Code Review
completed
Jul 7, 2026 in 14m 36s
Code review found 5 potential issues
Found 2 candidates, confirmed 5. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 5 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/jsc/event_loop.rs:473-476 |
drain_expired_timers doc comment overstates: says 'before the tasks and setImmediate' but only setImmediate is reordered |
| 🟡 Nit | src/jsc/VirtualMachine.rs:2467 |
PR description Known-exclusion stale after 4ee5409 re-added the unhandled_error_counter guard |
Annotations
Check warning on line 476 in src/jsc/event_loop.rs
claude / Claude Code Review
drain_expired_timers doc comment overstates: says 'before the tasks and setImmediate' but only setImmediate is reordered
The doc comment says the timer "dispatches before the tasks and `setImmediate` callbacks it queued", but both callers run `tick()` first — which dispatches the task queue — so only `setImmediate` is reordered, not tasks. Three sibling comments added in the same PR (VirtualMachine.rs:2451-2453, web_worker.rs:1137-1139, node-timers.test.ts:253-254) already state this correctly; suggest dropping "the tasks and" here (and adjusting "as it does in Node", since Node reorders both).
Check warning on line 2467 in src/jsc/VirtualMachine.rs
claude / Claude Code Review
PR description Known-exclusion stale after 4ee5409d re-added the unhandled_error_counter guard
The PR description's **Known exclusion** section is stale after 4ee5409d: it still says "Timer-vs-unhandled-rejection ordering is also left alone" and "a top-level `Promise.reject()` with a due timer may fire the timer before the rejection is reported", but this commit re-added the `unhandled_error_counter > unhandled_before` guard here and added a test asserting the timer does *not* fire on a top-level `Promise.reject()`. Suggest dropping/rewriting that paragraph (and optionally adding the unha
Loading