Skip to content

Commit 911f895

Browse files
fixup! wait for ready only if there is backpressure
1 parent b8f166c commit 911f895

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/internal/webstreams/readablestream.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,10 +1532,12 @@ function readableStreamPipeTo(
15321532
}
15331533

15341534
async function step() {
1535-
if (shuttingDown)
1536-
return true;
1535+
if (shuttingDown) return true;
15371536

1538-
await writer[kState].ready.promise;
1537+
if (dest[kState].backpressure) {
1538+
await writer[kState].ready.promise;
1539+
if (shuttingDown) return true;
1540+
}
15391541

15401542
const controller = source[kState].controller;
15411543

0 commit comments

Comments
 (0)