debugger: Fix inconsistent inspector output of `exec new Map()`
Fixed #42405 (closed)
The output string of exec
command is from RemoteObject[customInspectSymbol]
, but currently it doesn't support some object types such as Map
and Set
, which leads to invalid string representations (#42405 (closed)).
This PR implemented string representations when RemoteObject.subtype
is set
and map
. RemoteObject
has their abbreviation as ObjectPreview
in RemoteObject.preview
, which means we can construct their string representation from ObjectPreview
.
For example, new Set([ {a: 1}, new Set([1]) ])
is a RemoteObject that has two ObjectPreviews ({a: 1}
and new Set([1])
).
String representation of ObjectPreview {a: 1}
will be {a: 1}
and new Set([1])
will be Set(1) { ... }
. (Note that ObjectPreview treats an object nested in two or more layers as overflow, so overflowed object is converted to { ... }
)
1d0da48886f132b362bae680e07cf3b33627a883 added test cases for object type RemoteObject
7820dd4b2542cabb5ea6581be93f5c0d35b7e50a added ObjectPreview
and PropertyPreview
. And current string representation logics are ported to them.
5a4f767130e50002c98e214382a4dc74ab29f74a fixed string representations of Map
and Set
.