From df65edf9fc2eae19c36bfc2963d3fc262a569830 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 6 Apr 2017 16:43:13 -0700 Subject: [PATCH] Fix Microsoft/vscode#24143 - show "" for empty prop name/value --- src/chrome/chromeDebugAdapter.ts | 2 +- src/chrome/variables.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/chrome/chromeDebugAdapter.ts b/src/chrome/chromeDebugAdapter.ts index 020e00d72..988d2edc9 100644 --- a/src/chrome/chromeDebugAdapter.ts +++ b/src/chrome/chromeDebugAdapter.ts @@ -1766,7 +1766,7 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter { } return Promise.resolve({ - name, + name: name || `""`, value, variablesReference: 0, evaluateName: ChromeUtils.getEvaluateName(parentEvaluateName, name) diff --git a/src/chrome/variables.ts b/src/chrome/variables.ts index 212f6339b..dbdc921fc 100644 --- a/src/chrome/variables.ts +++ b/src/chrome/variables.ts @@ -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) {