From 5c9844e5f7074b2623ff0ddd69f5adcd1356ae38 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 23 Mar 2022 07:23:59 +0530 Subject: [PATCH] perf(http): avoid checking promise every request (#14079) --- ext/http/01_http.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/http/01_http.js b/ext/http/01_http.js index 2c15438142..91824b0001 100644 --- a/ext/http/01_http.js +++ b/ext/http/01_http.js @@ -39,7 +39,6 @@ ArrayPrototypeSome, Error, ObjectPrototypeIsPrototypeOf, - PromisePrototype, Set, SetPrototypeAdd, SetPrototypeDelete, @@ -183,10 +182,7 @@ ) { return async function respondWith(resp) { try { - if (ObjectPrototypeIsPrototypeOf(PromisePrototype, resp)) { - resp = await resp; - } - + resp = await resp; if (!(ObjectPrototypeIsPrototypeOf(ResponsePrototype, resp))) { throw new TypeError( "First argument to respondWith must be a Response or a promise resolving to a Response.",