Skip to content

Commit 7a756cb

Browse files
apapirovskiMylesBorins
authored andcommitted
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: #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>
1 parent 1722280 commit 7a756cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/_http_client.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ ClientRequest.prototype._implicitHeader = function _implicitHeader() {
327327

328328
ClientRequest.prototype.abort = function abort() {
329329
if (!this.aborted) {
330-
process.nextTick(emitAbortNT.bind(this));
330+
process.nextTick(emitAbortNT, this);
331331
}
332332
this.aborted = true;
333333

@@ -345,8 +345,8 @@ ClientRequest.prototype.abort = function abort() {
345345
};
346346

347347

348-
function emitAbortNT() {
349-
this.emit('abort');
348+
function emitAbortNT(req) {
349+
req.emit('abort');
350350
}
351351

352352
function ondrain() {

0 commit comments

Comments
 (0)