diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index 43ba749cd69946..def420b7ebaa31 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -4,7 +4,7 @@ const { ArrayPrototypePop, ArrayPrototypeSlice, ArrayPrototypeUnshift, - ErrorCaptureStackTrace, + FunctionPrototypeBind, ObjectPrototypeHasOwnProperty, ObjectDefineProperty, @@ -158,14 +158,7 @@ function executionAsyncResource() { // Used to fatally abort the process if a callback throws. function fatalError(e) { - if (typeof e.stack === 'string') { - process._rawDebug(e.stack); - } else { - const o = { message: e }; - ErrorCaptureStackTrace(o, fatalError); - process._rawDebug(o.stack); - } - + process._rawDebug(e.stack); const { getOptionValue } = require('internal/options'); if (getOptionValue('--abort-on-uncaught-exception')) { process.abort();