1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

LibWeb: Expose the ReadableStream tee IDL interface

This just sets up the plumbing to the underlying ReadableStreamTee AO,
which as of this commit, will just throw a NotImplemented exception.
This commit is contained in:
Timothy Flynn 2024-01-28 10:28:59 -05:00 committed by Andreas Kling
parent 5ccd1ff1bf
commit d8413774df
5 changed files with 43 additions and 1 deletions

View file

@ -108,6 +108,13 @@ WebIDL::ExceptionOr<ReadableStreamReader> ReadableStream::get_reader(ReadableStr
return ReadableStreamReader { TRY(acquire_readable_stream_byob_reader(*this)) };
}
// https://streams.spec.whatwg.org/#readablestream-tee
WebIDL::ExceptionOr<ReadableStreamPair> ReadableStream::tee()
{
// To tee a ReadableStream stream, return ? ReadableStreamTee(stream, true).
return TRY(readable_stream_tee(realm(), *this, true));
}
void ReadableStream::initialize(JS::Realm& realm)
{
Base::initialize(realm);