From 156b70a940ddb65789520e81505dd2de745a2f91 Mon Sep 17 00:00:00 2001 From: Pedro Lima Date: Fri, 21 Oct 2016 03:21:47 +0000 Subject: [PATCH 1/3] https: name anonymous functions in https related to commit ef030da which is naming anonymous functions to standardize the code --- lib/https.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/https.js b/lib/https.js index b8969b68452451..06a33f5aa1a0ca 100644 --- a/lib/https.js +++ b/lib/https.js @@ -43,7 +43,7 @@ exports.Server = Server; Server.prototype.setTimeout = http.Server.prototype.setTimeout; -exports.createServer = function(opts, requestListener) { +exports.createServer = function createServer(opts, requestListener) { return new Server(opts, requestListener); }; @@ -112,7 +112,7 @@ function Agent(options) { inherits(Agent, http.Agent); Agent.prototype.createConnection = createConnection; -Agent.prototype.getName = function(options) { +Agent.prototype.getName = function getName(options) { var name = http.Agent.prototype.getName.call(this, options); name += ':'; @@ -186,7 +186,7 @@ const globalAgent = new Agent(); exports.globalAgent = globalAgent; exports.Agent = Agent; -exports.request = function(options, cb) { +exports.request = function request(options, cb) { if (typeof options === 'string') { options = url.parse(options); if (!options.hostname) { @@ -199,7 +199,7 @@ exports.request = function(options, cb) { return http.request(options, cb); }; -exports.get = function(options, cb) { +exports.get = function get(options, cb) { var req = exports.request(options, cb); req.end(); return req; From fd487fad756bc9ebe5c352b942e0d4d651ab0769 Mon Sep 17 00:00:00 2001 From: Pedro Victor Date: Tue, 25 Oct 2016 01:30:15 -0200 Subject: [PATCH 2/3] https: name anonymous functions As stated in #9252 anonymous callback functions should be named, but not functions that are assigned to a property on a variable because the name is inferred from the assignment --- lib/https.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/https.js b/lib/https.js index 06a33f5aa1a0ca..3fc699d2bf0f8e 100644 --- a/lib/https.js +++ b/lib/https.js @@ -31,7 +31,7 @@ function Server(opts, requestListener) { this.addListener('request', requestListener); } - this.addListener('tlsClientError', function(err, conn) { + this.addListener('tlsClientError', function addListener(err, conn) { if (!this.emit('clientError', err, conn)) conn.destroy(err); }); @@ -43,7 +43,7 @@ exports.Server = Server; Server.prototype.setTimeout = http.Server.prototype.setTimeout; -exports.createServer = function createServer(opts, requestListener) { +exports.createServer = function(opts, requestListener) { return new Server(opts, requestListener); }; @@ -112,7 +112,7 @@ function Agent(options) { inherits(Agent, http.Agent); Agent.prototype.createConnection = createConnection; -Agent.prototype.getName = function getName(options) { +Agent.prototype.getName = function(options) { var name = http.Agent.prototype.getName.call(this, options); name += ':'; @@ -186,7 +186,7 @@ const globalAgent = new Agent(); exports.globalAgent = globalAgent; exports.Agent = Agent; -exports.request = function request(options, cb) { +exports.request = function(options, cb) { if (typeof options === 'string') { options = url.parse(options); if (!options.hostname) { @@ -199,7 +199,7 @@ exports.request = function request(options, cb) { return http.request(options, cb); }; -exports.get = function get(options, cb) { +exports.get = function(options, cb) { var req = exports.request(options, cb); req.end(); return req; From 3d00f1774010a77216c44a0cf4bc432aa4828621 Mon Sep 17 00:00:00 2001 From: Pedro Lima Date: Fri, 21 Oct 2016 03:21:47 +0000 Subject: [PATCH 3/3] https: name anonymous functions in https related to commit ef030da which is naming anonymous functions to standardize the code --- lib/https.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/https.js b/lib/https.js index 3fc699d2bf0f8e..26b6cbf279a15f 100644 --- a/lib/https.js +++ b/lib/https.js @@ -43,7 +43,7 @@ exports.Server = Server; Server.prototype.setTimeout = http.Server.prototype.setTimeout; -exports.createServer = function(opts, requestListener) { +exports.createServer = function createServer(opts, requestListener) { return new Server(opts, requestListener); }; @@ -112,7 +112,7 @@ function Agent(options) { inherits(Agent, http.Agent); Agent.prototype.createConnection = createConnection; -Agent.prototype.getName = function(options) { +Agent.prototype.getName = function getName(options) { var name = http.Agent.prototype.getName.call(this, options); name += ':'; @@ -186,7 +186,7 @@ const globalAgent = new Agent(); exports.globalAgent = globalAgent; exports.Agent = Agent; -exports.request = function(options, cb) { +exports.request = function request(options, cb) { if (typeof options === 'string') { options = url.parse(options); if (!options.hostname) { @@ -199,7 +199,7 @@ exports.request = function(options, cb) { return http.request(options, cb); }; -exports.get = function(options, cb) { +exports.get = function get(options, cb) { var req = exports.request(options, cb); req.end(); return req;