mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-03 07:54:40 +08:00
text(), json(), bytes() and the other body readers of a Response or Request whose body is a ReadableStream asked the stream's source for more chunks after draining its queue only when the stream had a zero high-water mark. When the queue had filled before the read began (a timer ran after the Response was made), the reader took the queued chunk and then waited for a close that no pull would bring, and the read never settled. The reader now pulls whenever it empties the queue, so it reads to the end, as Node does. This applies to streams from ReadableStream.from, from an underlying source, and to JavaScript ReadableStreams. Adds corpus programs fetch-body-queued-before-read.ts and fetch-body-queued-before-read-untyped.mjs, with their corpus costs and preflight/order baselines.