-
Notifications
You must be signed in to change notification settings - Fork 28.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debugger: Fix inconsistent inspector output of exec new Map()
#42423
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this! I like the new split here, just one nit/question.
exec new Map()
exec new Map()
The way these three commits are organized, the first commit adds a test that fails. This will break |
@Trott I squashed them into the one. |
throw error; | ||
} | ||
|
||
cli.waitForInitialBreak() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oy... rather than a long chain of thens... can we convert this into an async function with awaits please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think |
Most of them are. Maybe this one should be too. The ones in |
Landed in f890ef5 |
PR-URL: #42423 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #42423 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #42423 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #42423 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #42423 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: nodejs/node#42423 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Fixed #42405
The output string of
exec
command is fromRemoteObject[customInspectSymbol]
, but currently it doesn't support some object types such asMap
andSet
, which leads to invalid string representations (#42405).This PR implemented string representations when
RemoteObject.subtype
isset
andmap
.RemoteObject
has their abbreviation asObjectPreview
inRemoteObject.preview
, which means we can construct their string representation fromObjectPreview
.For example,
new Set([ {a: 1}, new Set([1]) ])
is a RemoteObject that has two ObjectPreviews ({a: 1}
andnew Set([1])
).String representation of ObjectPreview
{a: 1}
will be{a: 1}
andnew Set([1])
will beSet(1) { ... }
. (Note that ObjectPreview treats an object nested in two or more layers as overflow, so overflowed object is converted to{ ... }
)1d0da48 added test cases for object type RemoteObject
7820dd4 added
ObjectPreview
andPropertyPreview
. And current string representation logics are ported to them.5a4f767 fixed string representations of
Map
andSet
.