Skip to content

Fix formatting of number 0 in remote object when description is not set #1968

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

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

Beanyy
Copy link
Contributor

@Beanyy Beanyy commented Mar 14, 2024

Fix for issue reported here: #1967

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:

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);
}

Copy link
Member

@connor4312 connor4312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about the test failures, those are some known flakes I need to fix

@connor4312 connor4312 enabled auto-merge (squash) March 15, 2024 02:57
@vscodenpa vscodenpa added this to the March 2024 milestone Mar 15, 2024
@connor4312 connor4312 merged commit 82fb723 into microsoft:main Mar 15, 2024
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.

5 participants