Merge pull request #1062 from realm/blagoev/fix-RN-debug-with-vscode
Return debugger context if running on node in vscode debugger
This commit is contained in:
commit
416632c9ad
|
@ -27,6 +27,12 @@ function getContext() {
|
||||||
// If process is an object, we're probably running in Node or Electron
|
// If process is an object, we're probably running in Node or Electron
|
||||||
// From: http://stackoverflow.com/a/24279593/1417293
|
// From: http://stackoverflow.com/a/24279593/1417293
|
||||||
if (typeof process === 'object' && process + '' === '[object process]') {
|
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';
|
return process.type === 'renderer' ? 'electron' : 'nodejs';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue