1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-09-19 04:16:17 +00:00

LibWeb: Implement WritableStream.getWriter()

This commit is contained in:
Matthew Olsson 2023-04-02 07:22:11 -07:00 committed by Linus Groh
parent f358ae1b13
commit ae2d67c28b
5 changed files with 27 additions and 1 deletions

View file

@ -76,6 +76,13 @@ WebIDL::ExceptionOr<JS::GCPtr<JS::Object>> WritableStream::close()
return TRY(writable_stream_close(*this))->promise();
}
// https://streams.spec.whatwg.org/#ws-get-writer
WebIDL::ExceptionOr<JS::NonnullGCPtr<WritableStreamDefaultWriter>> WritableStream::get_writer()
{
// 1. Return ? AcquireWritableStreamDefaultWriter(this).
return acquire_writable_stream_default_writer(*this);
}
WritableStream::WritableStream(JS::Realm& realm)
: Bindings::PlatformObject(realm)
{