mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +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:
parent
e372b8b63e
commit
2c364d469b
|
|
@ -54,7 +54,7 @@ function writeToFile(message) {
|
|||
}
|
||||
|
||||
function doEmitWarning(warning) {
|
||||
return () => process.emit('warning', warning);
|
||||
process.emit('warning', warning);
|
||||
}
|
||||
|
||||
let traceWarningHelperShown = false;
|
||||
|
|
@ -140,7 +140,7 @@ function emitWarning(warning, type, code, ctor, now) {
|
|||
throw warning;
|
||||
}
|
||||
if (now) process.emit('warning', warning);
|
||||
else process.nextTick(doEmitWarning(warning));
|
||||
else process.nextTick(doEmitWarning, warning);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user