Skip to content

Commit

Permalink
lib: simplify function process.emitWarning
Browse files Browse the repository at this point in the history
PR-URL: #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 BridgeAR committed Apr 28, 2020
1 parent 1b61e56 commit 944dceb
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 @@ -54,7 +54,7 @@ function writeToFile(message) {
}

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

let traceWarningHelperShown = false;
Expand Down Expand Up @@ -140,7 +140,7 @@ function emitWarning(warning, type, code, ctor, now) {
throw warning;
}
if (now) process.emit('warning', warning);
else process.nextTick(doEmitWarning(warning));
else process.nextTick(doEmitWarning, warning);
}

module.exports = {
Expand Down

0 comments on commit 944dceb

Please sign in to comment.