0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01: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:
himself65 2020-04-22 14:27:49 +08:00 committed by Andrey Pechkurov
parent 0619b600b2
commit d01a06a916

View File

@ -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) {