Skip to content

Commit

Permalink
event: simplify domain conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Mar 30, 2021
1 parent 3bbace7 commit 110983c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 110983c

Please sign in to comment.