We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4e4e0a commit d46e020Copy full SHA for d46e020
lib/domain.js
@@ -402,8 +402,7 @@ EventEmitter.prototype.emit = function emit(...args) {
402
403
const type = args[0];
404
const doError = type === 'error' &&
405
- this._events !== undefined &&
406
- this._events.error !== undefined;
+ this.listenerCount(type) > 0;
407
408
if (doError || domain === null || domain === undefined || this === process) {
409
return Reflect.apply(eventEmit, this, args);
0 commit comments