Return debugger context if running on node in vscode debugger

Experimental
This commit is contained in:
blagoev 2017-05-29 09:33:06 +03:00
parent b78bcefc67
commit 3764d4bf55

View File

@ -28,6 +28,12 @@ function getContext() {
// If process is an object, we're probably running in Node or Electron
// From: http://stackoverflow.com/a/24279593/1417293
if (typeof process === 'object' && process + '' === '[object process]') {
// Visual Studio Code defines the global.__debug__ object.
if (typeof global !== 'undefined' && global.__debug__) {
return 'vscodedebugger';
}
return process.type === 'renderer' ? 'electron' : 'nodejs';
}