fix(debugger): return object/array results from debugger-evaluate#365
Draft
latekvo wants to merge 1 commit into
Draft
fix(debugger): return object/array results from debugger-evaluate#365latekvo wants to merge 1 commit into
latekvo wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
debugger-evaluatesilently returns nothing for any expression that evaluates to an object or array.CDPClient.evaluatecallsRuntime.evaluatewithoutreturnByValue, so a non-primitive result comes back as a RemoteObject reference with novaluefield, 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.evaluateWithBindingopts both off to keep its fire-and-forget binding path unchanged (it delivers its payload via a side binding, not the evaluate return).Verification
evaluatesendsreturnByValue:true+awaitPromise:trueand returns an object result, and thatevaluateWithBindingsends bothfalse.returnByValuepath is already exercised in production byreact-profiler-fiber-tree/react-profiler-renders.