http2: refactor to use more primordials

PR-URL: https://github.com/nodejs/node/pull/36357
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Antoine du Hamel authored and Danielle Adams committed 2020-12-07 13:55:52 -05:00
1 parent a15addc153
commit cedf51f3ce
1 file changed
+3 -2
+3 -2
View File
@@ -8,6 +8,7 @@ const {
ArrayPrototypeForEach,
ArrayPrototypePush,
FunctionPrototypeBind,
FunctionPrototypeCall,
MathMin,
ObjectAssign,
ObjectCreate,
@@ -2136,7 +2137,7 @@ class Http2Stream extends Duplex {
this[kState].didRead = true;
}
if (!this.pending) {
ReflectApply(streamOnResume, this, []);
FunctionPrototypeCall(streamOnResume, this);
} else {
this.once('ready', streamOnResume);
}
@@ -2953,7 +2954,7 @@ function connectionListener(socket) {
if (options.allowHTTP1 === true) {
socket.server[kIncomingMessage] = options.Http1IncomingMessage;
socket.server[kServerResponse] = options.Http1ServerResponse;
return httpConnectionListener.call(this, socket);
return FunctionPrototypeCall(httpConnectionListener, this, socket);
}
// Let event handler deal with the socket
debug('Unknown protocol from %s:%s',