Skip to content

Commit 0363f24

Browse files
committed
events: fix duplicate require which cause performance penalty
1 parent bbd4c6e commit 0363f24

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/events.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const {
5050
SymbolAsyncIterator,
5151
} = primordials;
5252
const kRejection = SymbolFor('nodejs.rejection');
53+
const { inspect } = require('internal/util/inspect');
5354

5455
let spliceOne;
5556

@@ -63,10 +64,6 @@ const {
6364
},
6465
} = require('internal/errors');
6566

66-
const {
67-
inspect
68-
} = require('internal/util/inspect');
69-
7067
const {
7168
validateAbortSignal,
7269
validateBoolean,
@@ -372,7 +369,6 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
372369
}
373370

374371
let stringifiedEr;
375-
const { inspect } = require('internal/util/inspect');
376372
try {
377373
stringifiedEr = inspect(er);
378374
} catch {

0 commit comments

Comments
 (0)