Skip to content

Commit

Permalink
lib: simplify function process.emitWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 committed Apr 22, 2020
1 parent 09a50d3 commit 46a3926
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/process/warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function writeToFile(message) {
}

function doEmitWarning(warning) {
return () => process.emit('warning', warning);
process.emit('warning', warning);
}

let traceWarningHelperShown = false;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 46a3926

Please sign in to comment.