Skip to content

Commit b152026

Browse files
himself65BethGriggs
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 e054ed5 commit b152026

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
@@ -55,7 +55,7 @@ function writeToFile(message) {
5555
}
5656

5757
function doEmitWarning(warning) {
58-
return () => process.emit('warning', warning);
58+
process.emit('warning', warning);
5959
}
6060

6161
let traceWarningHelperShown = false;
@@ -129,7 +129,7 @@ function emitWarning(warning, type, code, ctor) {
129129
if (process.throwDeprecation)
130130
throw warning;
131131
}
132-
process.nextTick(doEmitWarning(warning));
132+
process.nextTick(doEmitWarning, warning);
133133
}
134134

135135
function emitWarningSync(warning) {

0 commit comments

Comments
 (0)