summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-04-14 13:56:14 +0200
committerGitHub <noreply@github.com>2021-04-14 07:56:14 -0400
commit83f6d4bf940e8e6fa1393139df51916dbb94470b (patch)
tree867376a1bcfc2a7681385e08475073794a25c957 /runtime/js
parent262ee78592209a1f8e449cfa1308dca9688a414e (diff)
perf(js/http): avoid v8 deopt in async iterator (#10160)
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/40_http.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js
index 6b9d3dca6..3916b1df4 100644
--- a/runtime/js/40_http.js
+++ b/runtime/js/40_http.js
@@ -81,8 +81,8 @@
return {
async next() {
const reqEvt = await httpConn.nextRequest();
- if (reqEvt === null) return { value: undefined, done: true };
- return { value: reqEvt, done: false };
+ // Change with caution, current form avoids a v8 deopt
+ return { value: reqEvt, done: reqEvt === null };
},
};
}