Skip to content

Commit dce435d

Browse files
apapirovskitargos
authored andcommitted
http2: remove unnecessary bind from setImmediate
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 91845d8 commit dce435d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/internal/http2/core.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -2155,12 +2155,16 @@ class Http2Stream extends Duplex {
21552155
// By using setImmediate we allow pushStreams to make it through
21562156
// before the stream is officially closed. This prevents a bug
21572157
// in most browsers where those pushStreams would be rejected.
2158-
setImmediate(this.close.bind(this));
2158+
setImmediate(callStreamClose, this);
21592159
}
21602160
}
21612161
}
21622162
}
21632163

2164+
function callStreamClose(stream) {
2165+
stream.close();
2166+
}
2167+
21642168
function processHeaders(oldHeaders) {
21652169
assertIsObject(oldHeaders, 'headers');
21662170
const headers = Object.create(null);

0 commit comments

Comments
 (0)