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

Commit

Permalink
Fix #195
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Apr 6, 2017
1 parent 9af63c9 commit e173014
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/chrome/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ function getObjectPreview(object: Crdp.Runtime.RemoteObject, context?: string):
}

function propertyPreviewToString(prop: Crdp.Runtime.PropertyPreview): string {
const value = trimProperty(prop.value);
const value = typeof prop.value === 'undefined' ?
`<${prop.type}>` :
trimProperty(prop.value);

return prop.type === 'string' ?
`"${value}"` :
value;
Expand Down

7 comments on commit e173014

@mmfoscarpeerio
Copy link

Choose a reason for hiding this comment

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

Is this code pending release?

Node.js Tools 1.4.10918.1 is still throwing: Error processing "variables": TypeError: Cannot read property 'length' of undefined

@roblourens
Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's old. I don't know what Node.js Tools 1.4.10918.1 is. Is that in Visual Studio or vscode?

@mmfoscarpeerio
Copy link

Choose a reason for hiding this comment

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

It's Visual Studio Community 2017 Version 15.4.2

@roblourens
Copy link
Member Author

Choose a reason for hiding this comment

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

This is an extension for vscode, not related to the Visual Studio IDE.

@mmfoscarpeerio
Copy link

Choose a reason for hiding this comment

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

Interesting. In this environment just have Visual Studio with Node.js develoment enabled and the debug window shows the following error:

Error processing "variables": TypeError: Cannot read property 'length' of undefined
at trimProperty (C:\ProgramData\Microsoft\VisualStudio\NodeAdapter\0120e539\node_modules\vscode-chrome-debug-core\out\src\chrome\variables.js:167:18)
at propertyPreviewToString (C:\ProgramData\Microsoft\VisualStudio\NodeAdapter\0120e539\node_modules\vscode-chrome-debug-core\out\src\chrome\variables.js:161:19)
at props.map.prop (C:\ProgramData\Microsoft\VisualStudio\NodeAdapter\0120e539\node_modules\vscode-chrome-debug-core\out\src\chrome\variables.js:151:43)
at Array.map (native)
at getObjectPreview (C:\ProgramData\Microsoft\VisualStudio\NodeAdapter\0120e539\node_modules\vscode-chrome-debug-core\out\src\chrome\variables.js:151:14)
at Object.getRemoteObjectPreview (C:\ProgramData\Microsoft\VisualStudio\NodeAdapter\0120e539\node_modules\vscode-chrome-debug-core\out\src\chrome\variables.js:194:17)
at NodeDebugAdapter.createObjectVariable (C:\ProgramData\Microsoft\VisualStudio\NodeAdapter\0120e539\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugAdapter.js:1383:33)
at NodeDebugAdapter.remoteObjectToVariable (C:\ProgramData\Microsoft\VisualStudio\NodeAdapter\0120e539\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugAdapter.js:1325:33)
at NodeDebugAdapter.internalPropertyDescriptorToVariable (C:\ProgramData\Microsoft\VisualStudio\NodeAdapter\0120e539\node_modules\vscode-chrome-debug-core\out\src\chrome\chromeDebugAdapter.js:1090:21)

@roblourens
Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, there is an older version of this shipped with VS. I suppose the update will come with the next VS update.

@mmfoscarpeerio
Copy link

Choose a reason for hiding this comment

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

Ok, thanks for the heads up.

Please sign in to comment.