process: delay setup of global exception handlers
Since bootstrap/node.js performs the setup synchronously, the process exception handlers do not have to setup so early in the bootstrap process - any fatal errors thrown before user code execution should simply crash the process, and we do not care about any clean up at that point. We don't care about emitting any events if the process crash upon bootstrap either. PR-URL: https://github.com/nodejs/node/pull/26061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
parent
66942d7d86
commit
0eb71d4213
@ -46,24 +46,6 @@ setupTraceCategoryState();
|
||||
|
||||
setupProcessObject();
|
||||
|
||||
// TODO(joyeecheung): this does not have to done so early, any fatal errors
|
||||
// thrown before user code execution should simply crash the process
|
||||
// and we do not care about any clean up at that point. We don't care
|
||||
// about emitting any events if the process crash upon bootstrap either.
|
||||
{
|
||||
const {
|
||||
fatalException,
|
||||
setUncaughtExceptionCaptureCallback,
|
||||
hasUncaughtExceptionCaptureCallback
|
||||
} = NativeModule.require('internal/process/execution');
|
||||
|
||||
process._fatalException = fatalException;
|
||||
process.setUncaughtExceptionCaptureCallback =
|
||||
setUncaughtExceptionCaptureCallback;
|
||||
process.hasUncaughtExceptionCaptureCallback =
|
||||
hasUncaughtExceptionCaptureCallback;
|
||||
}
|
||||
|
||||
setupGlobalProxy();
|
||||
setupBuffer();
|
||||
|
||||
@ -265,6 +247,20 @@ Object.defineProperty(process, 'features', {
|
||||
}
|
||||
});
|
||||
|
||||
{
|
||||
const {
|
||||
fatalException,
|
||||
setUncaughtExceptionCaptureCallback,
|
||||
hasUncaughtExceptionCaptureCallback
|
||||
} = NativeModule.require('internal/process/execution');
|
||||
|
||||
process._fatalException = fatalException;
|
||||
process.setUncaughtExceptionCaptureCallback =
|
||||
setUncaughtExceptionCaptureCallback;
|
||||
process.hasUncaughtExceptionCaptureCallback =
|
||||
hasUncaughtExceptionCaptureCallback;
|
||||
}
|
||||
|
||||
// User-facing NODE_V8_COVERAGE environment variable that writes
|
||||
// ScriptCoverage to a specified file.
|
||||
if (process.env.NODE_V8_COVERAGE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user