Skip to content

Commit

Permalink
lib: simplify function process.emitWarning
Browse files Browse the repository at this point in the history
PR-URL: nodejs#32992
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Andrey Pechkurov <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
himself65 authored and puzpuzpuz committed Apr 24, 2020
1 parent 0619b60 commit d01a06a
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 d01a06a

Please sign in to comment.