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 <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
himself65 authored and BridgeAR committed Apr 28, 2020
1 parent e372b8b commit 2c364d4
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 2c364d4

Please sign in to comment.