summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-03-23 07:23:59 +0530
committerGitHub <noreply@github.com>2022-03-23 07:23:59 +0530
commit5c9844e5f7074b2623ff0ddd69f5adcd1356ae38 (patch)
treec5f1584cfb272f1fa17be9d9139432c6a3464571
parentc3f306d7782a30440435d4b3493a9f681bb31e09 (diff)
perf(http): avoid checking promise every request (#14079)
-rw-r--r--ext/http/01_http.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js
index 2c1543814..91824b000 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.",