mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
lib: simplify function process.emitWarning
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
bf331b4e21
commit
98b30b06ff
1 file changed
+2
-2
@@ -55,7 +55,7 @@ function writeToFile(message) {
|
||||
}
|
||||
|
||||
function doEmitWarning(warning) {
|
||||
return () => process.emit('warning', warning);
|
||||
process.emit('warning', warning);
|
||||
}
|
||||
|
||||
let traceWarningHelperShown = false;
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user