Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Fix microsoft/vscode#24143 - show "" for empty prop name/value
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Apr 6, 2017
1 parent b2664a4 commit df65edf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/chrome/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
}

return Promise.resolve(<DebugProtocol.Variable>{
name,
name: name || `""`,
value,
variablesReference: 0,
evaluateName: ChromeUtils.getEvaluateName(parentEvaluateName, name)
Expand Down
5 changes: 4 additions & 1 deletion src/chrome/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ function getObjectPreview(object: Crdp.Runtime.RemoteObject, context?: string):
const numProps = context === 'repl' ? PREVIEW_PROPS_CONSOLE : PREVIEW_PROPS_DEFAULT;
const props = object.preview.properties.slice(0, numProps);
let propsPreview = props
.map(prop => `${prop.name}: ${propertyPreviewToString(prop)}`)
.map(prop => {
const name = prop.name || `""`;
return `${name}: ${propertyPreviewToString(prop)}`;
})
.join(', ');

if (object.preview.overflow || object.preview.properties.length > numProps) {
Expand Down

0 comments on commit df65edf

Please sign in to comment.