mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
committed by
Rich Trott
parent
e17403ede3
commit
fea1f1cb9a
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user