From cedf51f3cee9f978866bab2c64eebfedf845465d Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 21 Nov 2020 20:16:45 +0100 Subject: [PATCH] http2: refactor to use more primordials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36357 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- lib/internal/http2/core.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index f685329574efe4..4fbee39c99ddf2 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -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',