diff options
author | himself65 <himself65@outlook.com> | 2020-04-22 14:27:49 +0800 |
---|---|---|
committer | Beth Griggs <Bethany.Griggs@uk.ibm.com> | 2020-04-28 16:28:29 +0100 |
commit | 98b30b06ff8ef32b70be2b4e5fcf867a41f1d45f (patch) | |
tree | 10fb267bf19975997a37b9ae0a4a1b794bbc6d29 | |
parent | bf331b4e21f3a76c99e65c45668747aa7a3a0787 (diff) | |
download | node-new-98b30b06ff8ef32b70be2b4e5fcf867a41f1d45f.tar.gz |
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>
-rw-r--r-- | lib/internal/process/warning.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 383bbd7e0f..ebf4c932fa 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -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) { |