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 BethGriggs committed Apr 28, 2020
1 parent bf331b4 commit 98b30b0
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 98b30b0

Please sign in to comment.