summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaasencioh <maasencioh@gmail.com>2016-10-12 13:06:30 +0200
committerJames M Snell <jasnell@gmail.com>2016-10-18 15:38:33 -0700
commit23d6e1f7bc3d416ec1540d5c73ee7c87f0115800 (patch)
treed3576273736bff485d188961308677ea670c0119
parentcb45374c31dc57e4610dfb1e7336a6ceb4d362b4 (diff)
downloadandroid-node-v8-23d6e1f7bc3d416ec1540d5c73ee7c87f0115800.tar.gz
android-node-v8-23d6e1f7bc3d416ec1540d5c73ee7c87f0115800.tar.bz2
android-node-v8-23d6e1f7bc3d416ec1540d5c73ee7c87f0115800.zip
http: name anonymous functions in _http_client
Refs: https://github.com/nodejs/node/issues/8913 PR-URL: https://github.com/nodejs/node/pull/9055 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
-rw-r--r--lib/_http_client.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 58fbf0f30a..6837c94df9 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -206,19 +206,19 @@ exports.ClientRequest = ClientRequest;
ClientRequest.prototype.aborted = undefined;
-ClientRequest.prototype._finish = function() {
+ClientRequest.prototype._finish = function _finish() {
DTRACE_HTTP_CLIENT_REQUEST(this, this.connection);
LTTNG_HTTP_CLIENT_REQUEST(this, this.connection);
COUNTER_HTTP_CLIENT_REQUEST();
OutgoingMessage.prototype._finish.call(this);
};
-ClientRequest.prototype._implicitHeader = function() {
+ClientRequest.prototype._implicitHeader = function _implicitHeader() {
this._storeHeader(this.method + ' ' + this.path + ' HTTP/1.1\r\n',
this._renderHeaders());
};
-ClientRequest.prototype.abort = function() {
+ClientRequest.prototype.abort = function abort() {
if (this.aborted === undefined) {
process.nextTick(emitAbortNT, this);
}
@@ -567,7 +567,7 @@ function tickOnSocket(req, socket) {
req.emit('socket', socket);
}
-ClientRequest.prototype.onSocket = function(socket) {
+ClientRequest.prototype.onSocket = function onSocket(socket) {
process.nextTick(onSocketNT, this, socket);
};
@@ -580,7 +580,8 @@ function onSocketNT(req, socket) {
}
}
-ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {
+ClientRequest.prototype._deferToConnect = _deferToConnect;
+function _deferToConnect(method, arguments_, cb) {
// This function is for calls that need to happen once the socket is
// connected and writable. It's an important promisy thing for all the socket
// calls that happen either now (when a socket is assigned) or
@@ -596,7 +597,7 @@ ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {
cb();
}
- var onSocket = function() {
+ var onSocket = function onSocket() {
if (self.socket.writable) {
callSocketMethod();
} else {
@@ -609,9 +610,9 @@ ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {
} else {
onSocket();
}
-};
+}
-ClientRequest.prototype.setTimeout = function(msecs, callback) {
+ClientRequest.prototype.setTimeout = function setTimeout(msecs, callback) {
if (callback) this.once('timeout', callback);
var self = this;
@@ -644,14 +645,14 @@ ClientRequest.prototype.setTimeout = function(msecs, callback) {
return this;
};
-ClientRequest.prototype.setNoDelay = function() {
+ClientRequest.prototype.setNoDelay = function setNoDelay() {
const argsLen = arguments.length;
const args = new Array(argsLen);
for (var i = 0; i < argsLen; i++)
args[i] = arguments[i];
this._deferToConnect('setNoDelay', args);
};
-ClientRequest.prototype.setSocketKeepAlive = function() {
+ClientRequest.prototype.setSocketKeepAlive = function setSocketKeepAlive() {
const argsLen = arguments.length;
const args = new Array(argsLen);
for (var i = 0; i < argsLen; i++)
@@ -659,6 +660,6 @@ ClientRequest.prototype.setSocketKeepAlive = function() {
this._deferToConnect('setKeepAlive', args);
};
-ClientRequest.prototype.clearTimeout = function(cb) {
+ClientRequest.prototype.clearTimeout = function clearTimeout(cb) {
this.setTimeout(0, cb);
};