Skip to content

fix(debugger): return object/array results from debugger-evaluate#365

Draft
latekvo wants to merge 1 commit into
mainfrom
fix/debugger-evaluate-return-by-value
Draft

fix(debugger): return object/array results from debugger-evaluate#365
latekvo wants to merge 1 commit into
mainfrom
fix/debugger-evaluate-return-by-value

Conversation

@latekvo

@latekvo latekvo commented Jun 17, 2026

Copy link
Copy Markdown
Member

Problem

debugger-evaluate silently returns nothing for any expression that evaluates to an object or array. CDPClient.evaluate calls Runtime.evaluate without returnByValue, so a non-primitive result comes back as a RemoteObject reference with no value field, and the tool drops it (only primitives/strings came through).

Fix

Pass returnByValue + awaitPromise (default on) so objects/arrays serialize by value and promise-returning expressions resolve to their value. evaluateWithBinding opts both off to keep its fire-and-forget binding path unchanged (it delivers its payload via a side binding, not the evaluate return).

Verification

  • New cdp-client unit tests assert evaluate sends returnByValue:true + awaitPromise:true and returns an object result, and that evaluateWithBinding sends both false.
  • Full cdp-client + reconnect suites pass; 1254 tool-server tests pass; eslint + prettier clean.
  • The real-Hermes returnByValue path is already exercised in production by react-profiler-fiber-tree / react-profiler-renders.

CDPClient.evaluate called Runtime.evaluate without returnByValue, so any
object/array result came back as a RemoteObject reference with no value
field and debugger-evaluate silently returned nothing for non-primitive
expressions. Pass returnByValue + awaitPromise (default on) so objects
serialize and promise-returning expressions resolve. evaluateWithBinding
opts out to keep its fire-and-forget binding path unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant