LibWeb: Implement ReadableStream's async iterator

This commit is contained in:
Timothy Flynn 2025-04-12 13:19:05 -04:00 committed by Tim Flynn
commit d5d9d999ae
Notes: github-actions[bot] 2025-04-14 21:44:12 +00:00
8 changed files with 261 additions and 43 deletions

View file

@ -24,8 +24,13 @@ dictionary ReadableStreamGetReaderOptions {
ReadableStreamReaderMode mode;
};
// https://streams.spec.whatwg.org/#dictdef-readablestreamiteratoroptions
dictionary ReadableStreamIteratorOptions {
boolean preventCancel = false;
};
// https://streams.spec.whatwg.org/#readablestream
[Exposed=*, Transferable]
[Exposed=*, Transferable, DefinesAsyncIteratorReturn]
interface ReadableStream {
constructor(optional object underlyingSource, optional QueuingStrategy strategy = {});
@ -39,7 +44,7 @@ interface ReadableStream {
Promise<undefined> pipeTo(WritableStream destination, optional StreamPipeOptions options = {});
sequence<ReadableStream> tee();
// FIXME: async iterable<any>(optional ReadableStreamIteratorOptions options = {});
async iterable<any>(optional ReadableStreamIteratorOptions options = {});
};
typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader;