From 15a616af51c8e985a2c217e714f7ab40b2b83dd1 Mon Sep 17 00:00:00 2001 From: Daven Casia Date: Fri, 13 Apr 2018 18:33:30 -0600 Subject: [PATCH 1/4] domain.js: Converted anonymous to named function --- lib/domain.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/domain.js b/lib/domain.js index 2515d996497218..802727c6cde448 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -184,7 +184,7 @@ class Domain extends EventEmitter { exports.Domain = Domain; -exports.create = exports.createDomain = function() { +exports.create = exports.createDomain = function createDomain() { return new Domain(); }; @@ -266,7 +266,7 @@ Domain.prototype._errorHandler = function _errorHandler(er) { }; -Domain.prototype.enter = function() { +Domain.prototype.enter = function enter() { // note that this might be a no-op, but we still need // to push it onto the stack so that we can pop it later. exports.active = process.domain = this; @@ -275,7 +275,7 @@ Domain.prototype.enter = function() { }; -Domain.prototype.exit = function() { +Domain.prototype.exit = function exit() { // don't do anything if this domain is not on the stack. var index = stack.lastIndexOf(this); if (index === -1) return; @@ -290,7 +290,7 @@ Domain.prototype.exit = function() { // note: this works for timers as well. -Domain.prototype.add = function(ee) { +Domain.prototype.add = function add(ee) { // If the domain is already added, then nothing left to do. if (ee.domain === this) return; @@ -319,7 +319,7 @@ Domain.prototype.add = function(ee) { }; -Domain.prototype.remove = function(ee) { +Domain.prototype.remove = function remove(ee) { ee.domain = null; var index = this.members.indexOf(ee); if (index !== -1) @@ -327,7 +327,7 @@ Domain.prototype.remove = function(ee) { }; -Domain.prototype.run = function(fn) { +Domain.prototype.run = function run(fn) { var ret; this.enter(); @@ -377,7 +377,7 @@ function intercepted(_this, self, cb, fnargs) { } -Domain.prototype.intercept = function(cb) { +Domain.prototype.intercept = function intercept(cb) { var self = this; function runIntercepted() { @@ -402,7 +402,7 @@ function bound(_this, self, cb, fnargs) { } -Domain.prototype.bind = function(cb) { +Domain.prototype.bind = function bind(cb) { var self = this; function runBound() { From 13a16e4fe44c2211f66601a06be0025d6bdf99ce Mon Sep 17 00:00:00 2001 From: Daven Casia Date: Sat, 14 Apr 2018 01:40:06 -0600 Subject: [PATCH 2/4] remove added names on prototypes --- lib/domain.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/domain.js b/lib/domain.js index 802727c6cde448..1c19f54c1231b6 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -266,7 +266,7 @@ Domain.prototype._errorHandler = function _errorHandler(er) { }; -Domain.prototype.enter = function enter() { +Domain.prototype.enter = function() { // note that this might be a no-op, but we still need // to push it onto the stack so that we can pop it later. exports.active = process.domain = this; @@ -275,7 +275,7 @@ Domain.prototype.enter = function enter() { }; -Domain.prototype.exit = function exit() { +Domain.prototype.exit = function() { // don't do anything if this domain is not on the stack. var index = stack.lastIndexOf(this); if (index === -1) return; @@ -290,7 +290,7 @@ Domain.prototype.exit = function exit() { // note: this works for timers as well. -Domain.prototype.add = function add(ee) { +Domain.prototype.add = function(ee) { // If the domain is already added, then nothing left to do. if (ee.domain === this) return; @@ -319,7 +319,7 @@ Domain.prototype.add = function add(ee) { }; -Domain.prototype.remove = function remove(ee) { +Domain.prototype.remove = function(ee) { ee.domain = null; var index = this.members.indexOf(ee); if (index !== -1) @@ -327,7 +327,7 @@ Domain.prototype.remove = function remove(ee) { }; -Domain.prototype.run = function run(fn) { +Domain.prototype.run = function(fn) { var ret; this.enter(); @@ -377,7 +377,7 @@ function intercepted(_this, self, cb, fnargs) { } -Domain.prototype.intercept = function intercept(cb) { +Domain.prototype.intercept = function(cb) { var self = this; function runIntercepted() { @@ -402,7 +402,7 @@ function bound(_this, self, cb, fnargs) { } -Domain.prototype.bind = function bind(cb) { +Domain.prototype.bind = function(cb) { var self = this; function runBound() { From 270b575c77ee30666ed64d4eb5d2879a0c896593 Mon Sep 17 00:00:00 2001 From: Daven Casia Date: Sat, 14 Apr 2018 02:00:36 -0600 Subject: [PATCH 3/4] remove added names on prototypes --- lib/domain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/domain.js b/lib/domain.js index 1c19f54c1231b6..a2474af937cfc9 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -193,7 +193,7 @@ exports.active = null; Domain.prototype.members = undefined; // Called by process._fatalException in case an error was thrown. -Domain.prototype._errorHandler = function _errorHandler(er) { +Domain.prototype._errorHandler = function(er) { var caught = false; if (!util.isPrimitive(er)) { From bfc18def96f67bcab560ce2daa4ff03163e82536 Mon Sep 17 00:00:00 2001 From: Daven Casia Date: Sat, 14 Apr 2018 08:58:21 -0600 Subject: [PATCH 4/4] remove added names on prototypes --- lib/domain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/domain.js b/lib/domain.js index a2474af937cfc9..beacdc89104411 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -428,7 +428,7 @@ EventEmitter.init = function() { }; const eventEmit = EventEmitter.prototype.emit; -EventEmitter.prototype.emit = function emit(...args) { +EventEmitter.prototype.emit = function(...args) { const domain = this.domain; const type = args[0];