http: remove unnecessary bind

process.nextTick accepts additional parameters which
are passed through to the callback. Use that instead
of binding the function to a context.

PR-URL: https://github.com/nodejs/node/pull/28131
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Anatoli Papirovski
2019-06-07 22:41:33 +02:00
committed by Rich Trott
parent e17403ede3
commit fea1f1cb9a

View File

@@ -327,7 +327,7 @@ ClientRequest.prototype._implicitHeader = function _implicitHeader() {
ClientRequest.prototype.abort = function abort() {
if (!this.aborted) {
process.nextTick(emitAbortNT.bind(this));
process.nextTick(emitAbortNT, this);
}
this.aborted = true;
@@ -345,8 +345,8 @@ ClientRequest.prototype.abort = function abort() {
};
function emitAbortNT() {
this.emit('abort');
function emitAbortNT(req) {
req.emit('abort');
}
function ondrain() {