-
Notifications
You must be signed in to change notification settings - Fork 345
Description
Describe the bug
Some Javascript Debuggee CDP implementations (Hermes) return the a RemoteObject of type=number , value=0 and the description and unserializableValue fields unset. This causes RemoteObjects with type=number and value=0 to be rendered as NaN due to the logic of formatting numbers here:
vscode-js-debug/src/adapter/objectPreview/index.ts
Lines 477 to 484 in 35c4aea
| if (param.type === 'number') { | |
| if ('unserializableValue' in param) { | |
| return param.unserializableValue; | |
| } | |
| const value = param.value || +param.description; | |
| return format?.hex ? value.toString(16) : String(value); | |
| } |
If param.value is falsy (as is for zero), it uses the description, but if that is unset it will display NaN.
I'm suggesting making an explicit check for positive zero here and assigniing it to value if the description is not set.
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Log File
VS Code Version: Replace me!
Additional context
Add any other context about the problem here.