Skip to content

Commit

Permalink
https: name anonymous functions in https
Browse files Browse the repository at this point in the history
Naming anonymous function in the https module

PR-URL: #9217
Ref: #8913
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
pvsousalima authored and addaleax committed Dec 5, 2016
1 parent 4fa84c9 commit 9554a97
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/https.js
Expand Up @@ -31,7 +31,7 @@ function Server(opts, requestListener) {
this.addListener('request', requestListener); this.addListener('request', requestListener);
} }


this.addListener('tlsClientError', function(err, conn) { this.addListener('tlsClientError', function addListener(err, conn) {
if (!this.emit('clientError', err, conn)) if (!this.emit('clientError', err, conn))
conn.destroy(err); conn.destroy(err);
}); });
Expand All @@ -43,7 +43,7 @@ exports.Server = Server;


Server.prototype.setTimeout = http.Server.prototype.setTimeout; Server.prototype.setTimeout = http.Server.prototype.setTimeout;


exports.createServer = function(opts, requestListener) { exports.createServer = function createServer(opts, requestListener) {
return new Server(opts, requestListener); return new Server(opts, requestListener);
}; };


Expand Down Expand Up @@ -112,7 +112,7 @@ function Agent(options) {
inherits(Agent, http.Agent); inherits(Agent, http.Agent);
Agent.prototype.createConnection = createConnection; Agent.prototype.createConnection = createConnection;


Agent.prototype.getName = function(options) { Agent.prototype.getName = function getName(options) {
var name = http.Agent.prototype.getName.call(this, options); var name = http.Agent.prototype.getName.call(this, options);


name += ':'; name += ':';
Expand Down Expand Up @@ -186,7 +186,7 @@ const globalAgent = new Agent();
exports.globalAgent = globalAgent; exports.globalAgent = globalAgent;
exports.Agent = Agent; exports.Agent = Agent;


exports.request = function(options, cb) { exports.request = function request(options, cb) {
if (typeof options === 'string') { if (typeof options === 'string') {
options = url.parse(options); options = url.parse(options);
if (!options.hostname) { if (!options.hostname) {
Expand All @@ -199,7 +199,7 @@ exports.request = function(options, cb) {
return http.request(options, cb); return http.request(options, cb);
}; };


exports.get = function(options, cb) { exports.get = function get(options, cb) {
var req = exports.request(options, cb); var req = exports.request(options, cb);
req.end(); req.end();
return req; return req;
Expand Down

0 comments on commit 9554a97

Please sign in to comment.