Skip to content

worker_threads: deliver the emit() payload to MessagePort listeners - #35796

Open
robobun wants to merge 12 commits into
mainfrom
farm/a40a02e0/messageport-emit-payload
Open

worker_threads: deliver the emit() payload to MessagePort listeners#35796
robobun wants to merge 12 commits into
mainfrom
farm/a40a02e0/messageport-emit-payload

worker_threads: deliver the emit() payload to MessagePort listeners

616169e
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 25, 2026 in 9m 58s

Code review found 1 potential issue

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

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/js/node/worker_threads.ts:202 emit() returns false when only addEventListener listeners are registered

Annotations

Check warning on line 202 in src/js/node/worker_threads.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

emit() returns false when only addEventListener listeners are registered

`emit()` now returns `false` when the only listeners were registered via `addEventListener()` (not `.on()`), whereas Node returns `true` — `listenerCount()` here only reads the JS-side `.on()`/`.once()` registry, not the native EventTarget's listener map that `addEventListener` writes to. The underlying `listenerCount()` gap is pre-existing (it already returned 0 for such listeners), so a proper fix belongs there rather than in this PR; noting it because the new return value now exposes it where