From 0f9ffa1c32d36d358cc150bc874d0be538b73ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 25 Aug 2021 09:01:17 +0200 Subject: [PATCH] events: fix duplicate require which cause performance penalty --- lib/events.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/events.js b/lib/events.js index 557461084631f3..ef8090e57778e7 100644 --- a/lib/events.js +++ b/lib/events.js @@ -50,6 +50,7 @@ const { SymbolAsyncIterator, } = primordials; const kRejection = SymbolFor('nodejs.rejection'); +const { inspect } = require('internal/util/inspect'); let spliceOne; @@ -63,10 +64,6 @@ const { }, } = require('internal/errors'); -const { - inspect -} = require('internal/util/inspect'); - const { validateAbortSignal, validateBoolean, @@ -372,7 +369,6 @@ EventEmitter.prototype.emit = function emit(type, ...args) { } let stringifiedEr; - const { inspect } = require('internal/util/inspect'); try { stringifiedEr = inspect(er); } catch {