diff --git a/lib/events.js b/lib/events.js index 34fc841b55e2af..efe7bd3691c6bd 100644 --- a/lib/events.js +++ b/lib/events.js @@ -342,11 +342,11 @@ EventEmitter.prototype.emit = function emit(type, ...args) { let er; if (args.length > 0) er = args[0]; - if (domain !== null && domain !== undefined) { + if (domain) { if (!er) { er = new ERR_UNHANDLED_ERROR(); } - if (typeof er === 'object' && er !== null) { + if (typeof er === 'object') { er.domainEmitter = this; er.domain = domain; er.domainThrown = false;