diff --git a/src/vs/workbench/api/node/extensionHostProcess.ts b/src/vs/workbench/api/node/extensionHostProcess.ts index feaece95534e..704a0dbb5bd6 100644 --- a/src/vs/workbench/api/node/extensionHostProcess.ts +++ b/src/vs/workbench/api/node/extensionHostProcess.ts @@ -103,9 +103,10 @@ function patchProcess(allowExit: boolean) { process.on = function (event: string, listener: (...args: any[]) => void) { if (event === 'uncaughtException') { - listener = function () { + const actualListener = listener; + listener = function (...args: any[]) { try { - return listener.call(undefined, arguments); + return actualListener.apply(undefined, args); } catch { // DO NOT HANDLE NOR PRINT the error here because this can and will lead to // more errors which will cause error handling to be reentrant and eventually