mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 21:50:00 -05:00
fix(ext/web/streams): enqueue to second branch before closing (#16269)
Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
parent
0d6dbc08be
commit
e6e2898190
2 changed files with 10 additions and 7 deletions
|
@ -2616,6 +2616,7 @@
|
||||||
assert(typeof cloneForBranch2 === "boolean");
|
assert(typeof cloneForBranch2 === "boolean");
|
||||||
const reader = acquireReadableStreamDefaultReader(stream);
|
const reader = acquireReadableStreamDefaultReader(stream);
|
||||||
let reading = false;
|
let reading = false;
|
||||||
|
let readAgain = false;
|
||||||
let canceled1 = false;
|
let canceled1 = false;
|
||||||
let canceled2 = false;
|
let canceled2 = false;
|
||||||
/** @type {any} */
|
/** @type {any} */
|
||||||
|
@ -2634,6 +2635,7 @@
|
||||||
|
|
||||||
function pullAlgorithm() {
|
function pullAlgorithm() {
|
||||||
if (reading === true) {
|
if (reading === true) {
|
||||||
|
readAgain = true;
|
||||||
return resolvePromiseWith(undefined);
|
return resolvePromiseWith(undefined);
|
||||||
}
|
}
|
||||||
reading = true;
|
reading = true;
|
||||||
|
@ -2641,7 +2643,7 @@
|
||||||
const readRequest = {
|
const readRequest = {
|
||||||
chunkSteps(value) {
|
chunkSteps(value) {
|
||||||
queueMicrotask(() => {
|
queueMicrotask(() => {
|
||||||
reading = false;
|
readAgain = false;
|
||||||
const value1 = value;
|
const value1 = value;
|
||||||
const value2 = value;
|
const value2 = value;
|
||||||
|
|
||||||
|
@ -2663,6 +2665,11 @@
|
||||||
value2,
|
value2,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reading = false;
|
||||||
|
if (readAgain === true) {
|
||||||
|
pullAlgorithm();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
closeSteps() {
|
closeSteps() {
|
||||||
|
|
|
@ -1336,12 +1336,8 @@
|
||||||
"patched-global.any.worker.html": true,
|
"patched-global.any.worker.html": true,
|
||||||
"reentrant-strategies.any.html": true,
|
"reentrant-strategies.any.html": true,
|
||||||
"reentrant-strategies.any.worker.html": true,
|
"reentrant-strategies.any.worker.html": true,
|
||||||
"tee.any.html": [
|
"tee.any.html": true,
|
||||||
"ReadableStream teeing: enqueue() and close() while both branches are pulling"
|
"tee.any.worker.html": true,
|
||||||
],
|
|
||||||
"tee.any.worker.html": [
|
|
||||||
"ReadableStream teeing: enqueue() and close() while both branches are pulling"
|
|
||||||
],
|
|
||||||
"templated.any.html": true,
|
"templated.any.html": true,
|
||||||
"templated.any.worker.html": true
|
"templated.any.worker.html": true
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue