summaryrefslogtreecommitdiff
path: root/lib/domain.js
diff options
context:
space:
mode:
authorJackson Tian <puling.tyq@alibaba-inc.com>2016-02-15 12:53:17 +0800
committerJames M Snell <jasnell@gmail.com>2016-03-21 15:48:51 -0700
commitd2b93e55cc941c33f06af11304eee119d56abbbe (patch)
tree0182073ae17662f6eac4dc0e7cc1705227864831 /lib/domain.js
parentf70c71f168ecf298733617c4c7ff445740d708ee (diff)
downloadnode-new-d2b93e55cc941c33f06af11304eee119d56abbbe.tar.gz
lib: reduce usage of `self = this`
Remove unnecessary `self = this`. PR-URL: https://github.com/nodejs/node/pull/5231 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/domain.js')
-rw-r--r--lib/domain.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/domain.js b/lib/domain.js
index 41b4859361..d6958b2c30 100644
--- a/lib/domain.js
+++ b/lib/domain.js
@@ -60,7 +60,6 @@ Domain.prototype._disposed = undefined;
// Called by process._fatalException in case an error was thrown.
Domain.prototype._errorHandler = function errorHandler(er) {
var caught = false;
- var self = this;
// ignore errors on disposed domains.
//
@@ -89,13 +88,13 @@ Domain.prototype._errorHandler = function errorHandler(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(self, 'error') > 0) {
+ if (EventEmitter.listenerCount(this, 'error') > 0) {
try {
// Set the _emittingTopLevelDomainError so that we know that, even
// if technically the top-level domain is still active, it would
// be ok to abort on an uncaught exception at this point
process._emittingTopLevelDomainError = true;
- caught = self.emit('error', er);
+ caught = this.emit('error', er);
} finally {
process._emittingTopLevelDomainError = false;
}
@@ -111,7 +110,7 @@ Domain.prototype._errorHandler = function errorHandler(er) {
//
// If caught is false after this, then there's no need to exit()
// the domain, because we're going to crash the process anyway.
- caught = self.emit('error', er);
+ caught = this.emit('error', er);
} catch (er2) {
// The domain error handler threw! oh no!
// See if another domain can catch THIS error,