diff --git a/lib/domain.js b/lib/domain.js index 03d240e98d4..7dd16ee1bf5 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -270,7 +270,7 @@ Domain.prototype._errorHandler = function(er) { // as this would throw an error, make the process exit, and thus // prevent the process 'uncaughtException' event from being emitted // if a listener is set. - if (EventEmitter.listenerCount(this, 'error') > 0) { + if (this.listenerCount('error') > 0) { // Clear the uncaughtExceptionCaptureCallback so that we know that, since // the top-level domain is not active anymore, it would be ok to abort on // an uncaught exception at this point