Skip to content

Commit

Permalink
Fixes #33196: Remove Electron 2.x workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Sep 17, 2018
1 parent af6d675 commit e4ede32
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions src/vs/workbench/node/extensionHostMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,7 @@ function patchProcess(allowExit: boolean) {
}

export function exit(code?: number) {
// See https://github.com/Microsoft/vscode/issues/32990
// calling process.exit() does not exit the process when the process is being debugged
// It waits for the debugger to disconnect, but in our version, the debugger does not
// receive an event that the process desires to exit such that it can disconnect.

let watchdog: { exit: (exitCode: number) => void; } = null;
try {
watchdog = require.__$__nodeRequire('native-watchdog');
} catch (err) {
nativeExit(code);
return;
}

// Do exactly what node.js would have done, minus the wait for the debugger part

if (code || code === 0) {
process.exitCode = code;
}

if (!(<any>process)._exiting) {
(<any>process)._exiting = true;
process.emit('exit', process.exitCode || 0);
}
watchdog.exit(process.exitCode || 0);
nativeExit(code);
}

interface ITestRunner {
Expand Down

0 comments on commit e4ede32

Please sign in to comment.