Error.captureStackTrace: lazily compute .stack header on non-Error targets - #35640
Open
robobun wants to merge 6 commits into
Open
Error.captureStackTrace: lazily compute .stack header on non-Error targets#35640robobun wants to merge 6 commits into
robobun wants to merge 6 commits into
Claude / Claude Code Review
completed
Jul 25, 2026 in 43m 13s
Code review found 1 potential issue
Found 1 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/jsc/bindings/FormatStackTraceForJS.cpp:808-809 |
getPrototypeDirect() proto-walk misses holder when receiver is a Proxy |
Annotations
Check warning on line 809 in src/jsc/bindings/FormatStackTraceForJS.cpp
claude / Claude Code Review
getPrototypeDirect() proto-walk misses holder when receiver is a Proxy
The proto-chain walk advances via `o->getPrototypeDirect()`, which reads the structure's stored prototype and bypasses `[[GetPrototypeOf]]` — for a `ProxyObject` that's `jsNull()`, so `const t = {}; Error.captureStackTrace(t); new Proxy(t, {}).stack` now returns `undefined` instead of the stack string (a regression from both pre-PR Bun and Node, on the same receiver-vs-holder axis the walk was added to fix). Unwrapping `ProxyObject` to its `target()` before/inside the loop (iteratively, for nest
Loading