Skip to content

ai slop - #29200

Closed
robobun wants to merge 3 commits into
mainfrom
farm/d34ca4b8/worker-terminate-uaf-and-mock-construct
Closed

ai slop#29200
robobun wants to merge 3 commits into
mainfrom
farm/d34ca4b8/worker-terminate-uaf-and-mock-construct

Replace tautological assertion in worker-terminate-after-exit test

6c6de4f
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 11, 2026 in 13m 12s

Code review found 2 potential issues

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

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/bun.js/bindings/JSMockFunction.cpp:982-1001 mockReturnThis+contexts incorrect in construct context due to thisValue==newTarget

Annotations

Check warning on line 1001 in src/bun.js/bindings/JSMockFunction.cpp

See this annotation in the file changed.

@claude claude / Claude Code Review

mockReturnThis+contexts incorrect in construct context due to thisValue==newTarget

When jsMockFunctionConstruct delegates to jsMockFunctionCall, the thisValue captured inside jsMockFunctionCall is callframe->thisValue(), which for JSC InternalFunction native constructors equals newTarget() (the constructor function itself). This causes two observable deviations from Jest semantics: (1) mock().mockReturnThis() used as a constructor via Reflect.construct returns the mock function itself as the result (since result.isObject() is true for functions); (2) mock.mock.contexts records