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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
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

+3-3
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)