From 46a3926aec72517c8b5974d464de18812815f751 Mon Sep 17 00:00:00 2001 From: himself65 Date: Wed, 22 Apr 2020 14:27:49 +0800 Subject: [PATCH] lib: simplify function process.emitWarning --- lib/internal/process/warning.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 383bbd7e0fe79f..ebf4c932fa9c57 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) {