Skip to content

Error.captureStackTrace: lazily compute .stack header on non-Error targets - #35640

Open
robobun wants to merge 6 commits into
mainfrom
farm/2631d62a/capture-stack-trace-non-error-header
Open

Error.captureStackTrace: lazily compute .stack header on non-Error targets#35640
robobun wants to merge 6 commits into
mainfrom
farm/2631d62a/capture-stack-trace-non-error-header

[autofix.ci] apply automated fixes

644df87
Select commit
Loading
Failed to load commit list.
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

See this annotation in the file changed.

@claude 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