Skip to content

Commit

Permalink
http2: remove unnecessary bind from setImmediate
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
apapirovski authored and BethGriggs committed Feb 6, 2020
1 parent cc9712d commit 84603ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2155,12 +2155,16 @@ class Http2Stream extends Duplex {
// By using setImmediate we allow pushStreams to make it through
// before the stream is officially closed. This prevents a bug
// in most browsers where those pushStreams would be rejected.
setImmediate(this.close.bind(this));
setImmediate(callStreamClose, this);
}
}
}
}

function callStreamClose(stream) {
stream.close();
}

function processHeaders(oldHeaders) {
assertIsObject(oldHeaders, 'headers');
const headers = Object.create(null);
Expand Down

0 comments on commit 84603ec

Please sign in to comment.