Stop dispatching parent messages to self.onmessage in node:worker_threads workers #29215
+1,163
−11
Claude / Claude Code Review
completed
May 4, 2026 in 21m 30s
Code review found 1 potential issue
Found 6 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:339 |
bucket.$size is not a valid Map intrinsic — eager WeakMap cleanup is dead code |
Annotations
Check warning on line 339 in src/js/node/worker_threads.ts
claude / Claude Code Review
bucket.$size is not a valid Map intrinsic — eager WeakMap cleanup is dead code
`bucket.$size` is not a valid Map intrinsic — `builtins.d.ts` only declares `$get/$set/$has/$delete/$clear` for Map, so after codegen this becomes `bucket.@size` which is `undefined` at runtime, and `undefined === 0` is always false. The eager `trackedByListener.delete(listener)` cleanup is therefore dead code; use the public `bucket.size` accessor instead. (No functional impact — `trackedByListener` is a WeakMap and all callers handle empty-but-present buckets correctly.)
Loading