Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events: fix duplicate require which cause performance penalty #39892

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/events.js
Expand Up @@ -50,6 +50,7 @@ const {
SymbolAsyncIterator,
} = primordials;
const kRejection = SymbolFor('nodejs.rejection');
const { inspect } = require('internal/util/inspect');

let spliceOne;

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

const {
inspect
} = require('internal/util/inspect');
wwwzbwcom marked this conversation as resolved.
Show resolved Hide resolved

const {
validateAbortSignal,
validateBoolean,
Expand Down Expand Up @@ -372,7 +369,6 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
}

let stringifiedEr;
const { inspect } = require('internal/util/inspect');
try {
stringifiedEr = inspect(er);
} catch {
Expand Down