mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 05:35:33 +00:00
fix(core): fix APIs not to be affected by Promise.prototype.then
modification (#16326)
This commit is contained in:
parent
edaceecec7
commit
59ac110edd
8 changed files with 145 additions and 42 deletions
|
@ -529,14 +529,15 @@
|
|||
// 2.6.
|
||||
// Rather than consuming the body as an ArrayBuffer, this passes each
|
||||
// chunk to the feed as soon as it's available.
|
||||
(async () => {
|
||||
const reader = res.body.getReader();
|
||||
while (true) {
|
||||
const { value: chunk, done } = await reader.read();
|
||||
if (done) break;
|
||||
ops.op_wasm_streaming_feed(rid, chunk);
|
||||
}
|
||||
})().then(
|
||||
PromisePrototypeThen(
|
||||
(async () => {
|
||||
const reader = res.body.getReader();
|
||||
while (true) {
|
||||
const { value: chunk, done } = await reader.read();
|
||||
if (done) break;
|
||||
ops.op_wasm_streaming_feed(rid, chunk);
|
||||
}
|
||||
})(),
|
||||
// 2.7
|
||||
() => core.close(rid),
|
||||
// 2.8
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue