LibWeb: Implement static method ReadableStream.from(asyncIterable)

This commit is contained in:
Kenneth Myhra 2024-06-08 10:44:35 +02:00 committed by Andreas Kling
commit 0ec0e92b10
Notes: sideshowbarker 2024-07-17 01:46:43 +09:00
5 changed files with 45 additions and 1 deletions

View file

@ -68,6 +68,13 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<ReadableStream>> ReadableStream::construct_
return readable_stream;
}
// https://streams.spec.whatwg.org/#rs-from
WebIDL::ExceptionOr<JS::NonnullGCPtr<ReadableStream>> ReadableStream::from(JS::VM& vm, JS::Value async_iterable)
{
// 1. Return ? ReadableStreamFromIterable(asyncIterable).
return TRY(readable_stream_from_iterable(vm, async_iterable));
}
ReadableStream::ReadableStream(JS::Realm& realm)
: PlatformObject(realm)
{