Skip to content

Commit baece55

Browse files
apapirovskitargos
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 9b730ad commit baece55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/_http_client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ ClientRequest.prototype._implicitHeader = function _implicitHeader() {
313313

314314
ClientRequest.prototype.abort = function abort() {
315315
if (!this.aborted) {
316-
process.nextTick(emitAbortNT.bind(this));
316+
process.nextTick(emitAbortNT, this);
317317
}
318318
this.aborted = true;
319319

@@ -331,8 +331,8 @@ ClientRequest.prototype.abort = function abort() {
331331
};
332332

333333

334-
function emitAbortNT() {
335-
this.emit('abort');
334+
function emitAbortNT(req) {
335+
req.emit('abort');
336336
}
337337

338338
function ondrain() {

0 commit comments

Comments
 (0)