Skip to content

Commit ec17e76

Browse files
maasenciohjasnell
authored andcommitted
http: name anonymous functions in _http_client
Refs: #8913 PR-URL: #9055 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 9099a43 commit ec17e76

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

lib/_http_client.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,19 +206,19 @@ exports.ClientRequest = ClientRequest;
206206

207207
ClientRequest.prototype.aborted = undefined;
208208

209-
ClientRequest.prototype._finish = function() {
209+
ClientRequest.prototype._finish = function _finish() {
210210
DTRACE_HTTP_CLIENT_REQUEST(this, this.connection);
211211
LTTNG_HTTP_CLIENT_REQUEST(this, this.connection);
212212
COUNTER_HTTP_CLIENT_REQUEST();
213213
OutgoingMessage.prototype._finish.call(this);
214214
};
215215

216-
ClientRequest.prototype._implicitHeader = function() {
216+
ClientRequest.prototype._implicitHeader = function _implicitHeader() {
217217
this._storeHeader(this.method + ' ' + this.path + ' HTTP/1.1\r\n',
218218
this._renderHeaders());
219219
};
220220

221-
ClientRequest.prototype.abort = function() {
221+
ClientRequest.prototype.abort = function abort() {
222222
if (this.aborted === undefined) {
223223
process.nextTick(emitAbortNT, this);
224224
}
@@ -567,7 +567,7 @@ function tickOnSocket(req, socket) {
567567
req.emit('socket', socket);
568568
}
569569

570-
ClientRequest.prototype.onSocket = function(socket) {
570+
ClientRequest.prototype.onSocket = function onSocket(socket) {
571571
process.nextTick(onSocketNT, this, socket);
572572
};
573573

@@ -580,7 +580,8 @@ function onSocketNT(req, socket) {
580580
}
581581
}
582582

583-
ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {
583+
ClientRequest.prototype._deferToConnect = _deferToConnect;
584+
function _deferToConnect(method, arguments_, cb) {
584585
// This function is for calls that need to happen once the socket is
585586
// connected and writable. It's an important promisy thing for all the socket
586587
// calls that happen either now (when a socket is assigned) or
@@ -596,7 +597,7 @@ ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {
596597
cb();
597598
}
598599

599-
var onSocket = function() {
600+
var onSocket = function onSocket() {
600601
if (self.socket.writable) {
601602
callSocketMethod();
602603
} else {
@@ -609,9 +610,9 @@ ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {
609610
} else {
610611
onSocket();
611612
}
612-
};
613+
}
613614

614-
ClientRequest.prototype.setTimeout = function(msecs, callback) {
615+
ClientRequest.prototype.setTimeout = function setTimeout(msecs, callback) {
615616
if (callback) this.once('timeout', callback);
616617

617618
var self = this;
@@ -644,21 +645,21 @@ ClientRequest.prototype.setTimeout = function(msecs, callback) {
644645
return this;
645646
};
646647

647-
ClientRequest.prototype.setNoDelay = function() {
648+
ClientRequest.prototype.setNoDelay = function setNoDelay() {
648649
const argsLen = arguments.length;
649650
const args = new Array(argsLen);
650651
for (var i = 0; i < argsLen; i++)
651652
args[i] = arguments[i];
652653
this._deferToConnect('setNoDelay', args);
653654
};
654-
ClientRequest.prototype.setSocketKeepAlive = function() {
655+
ClientRequest.prototype.setSocketKeepAlive = function setSocketKeepAlive() {
655656
const argsLen = arguments.length;
656657
const args = new Array(argsLen);
657658
for (var i = 0; i < argsLen; i++)
658659
args[i] = arguments[i];
659660
this._deferToConnect('setKeepAlive', args);
660661
};
661662

662-
ClientRequest.prototype.clearTimeout = function(cb) {
663+
ClientRequest.prototype.clearTimeout = function clearTimeout(cb) {
663664
this.setTimeout(0, cb);
664665
};

0 commit comments

Comments
 (0)