diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 383bbd7e0fe79f..ebf4c932fa9c57 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -55,7 +55,7 @@ function writeToFile(message) { } function doEmitWarning(warning) { - return () => process.emit('warning', warning); + process.emit('warning', warning); } let traceWarningHelperShown = false; @@ -129,7 +129,7 @@ function emitWarning(warning, type, code, ctor) { if (process.throwDeprecation) throw warning; } - process.nextTick(doEmitWarning(warning)); + process.nextTick(doEmitWarning, warning); } function emitWarningSync(warning) {