MCPcopy Index your code
hub / github.com/nodejs/node / readableStreamFulfillReadRequest

Function readableStreamFulfillReadRequest

lib/internal/webstreams/readablestream.js:2258–2274  ·  view source on GitHub ↗
(stream, chunk, done)

Source from the content-addressed store, hash-verified

2256}
2257
2258function readableStreamFulfillReadRequest(stream, chunk, done) {
2259 assert(readableStreamHasDefaultReader(stream));
2260 const {
2261 reader,
2262 } = stream[kState];
2263 assert(reader[kState].readRequests.length);
2264 const readRequest = ArrayPrototypeShift(reader[kState].readRequests);
2265
2266 // TODO(@jasnell): It's not clear under what exact conditions done
2267 // will be true here. The spec requires this check but none of the
2268 // WPT's or other tests trigger it. Will need to investigate how to
2269 // get coverage for this.
2270 if (done)
2271 readRequest[kClose]();
2272 else
2273 readRequest[kChunk](chunk);
2274}
2275
2276function readableStreamFulfillReadIntoRequest(stream, chunk, done) {
2277 assert(readableStreamHasBYOBReader(stream));

Calls 2

assertFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…