Skip to content

Commit 944dceb

Browse files
himself65BridgeAR
authored andcommitted
lib: simplify function process.emitWarning
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>
1 parent 1b61e56 commit 944dceb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/process/warning.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function writeToFile(message) {
5454
}
5555

5656
function doEmitWarning(warning) {
57-
return () => process.emit('warning', warning);
57+
process.emit('warning', warning);
5858
}
5959

6060
let traceWarningHelperShown = false;
@@ -140,7 +140,7 @@ function emitWarning(warning, type, code, ctor, now) {
140140
throw warning;
141141
}
142142
if (now) process.emit('warning', warning);
143-
else process.nextTick(doEmitWarning(warning));
143+
else process.nextTick(doEmitWarning, warning);
144144
}
145145

146146
module.exports = {

0 commit comments

Comments
 (0)