Skip to content

Commit 110983c

Browse files
committed
event: simplify domain conditions
1 parent 3bbace7 commit 110983c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/events.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
342342
let er;
343343
if (args.length > 0)
344344
er = args[0];
345-
if (domain !== null && domain !== undefined) {
345+
if (domain) {
346346
if (!er) {
347347
er = new ERR_UNHANDLED_ERROR();
348348
}
349-
if (typeof er === 'object' && er !== null) {
349+
if (typeof er === 'object') {
350350
er.domainEmitter = this;
351351
er.domain = domain;
352352
er.domainThrown = false;

0 commit comments

Comments
 (0)