diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2023-04-09 10:42:13 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-27 07:57:53 +0200 |
commit | ed06429d33964a88754ada727937b6bb5a6407d6 (patch) | |
tree | f9fbe4454feae16930b7cb264c20940b4e7398dd /Userland/Libraries/LibWeb/Streams | |
parent | c9be75536733f66dfa0a8fc9a6251f2bb5031881 (diff) | |
download | serenity-ed06429d33964a88754ada727937b6bb5a6407d6.zip |
LibWeb: Implement ReadableByteStreamController.error()
Diffstat (limited to 'Userland/Libraries/LibWeb/Streams')
3 files changed, 9 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.cpp b/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.cpp index 11f54242e8..1c0974ad6a 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.cpp @@ -37,6 +37,13 @@ WebIDL::ExceptionOr<void> ReadableByteStreamController::close() return {}; } +// https://streams.spec.whatwg.org/#rbs-controller-error +void ReadableByteStreamController::error(JS::Value error) +{ + // 1. Perform ! ReadableByteStreamControllerError(this, e). + readable_byte_stream_controller_error(*this, error); +} + ReadableByteStreamController::ReadableByteStreamController(JS::Realm& realm) : Bindings::PlatformObject(realm) { diff --git a/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.h b/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.h index 520f554953..f4e3c79804 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.h +++ b/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.h @@ -81,6 +81,7 @@ public: Optional<double> desired_size() const; WebIDL::ExceptionOr<void> close(); + void error(JS::Value error); Optional<u32> const& auto_allocate_chunk_size() { return m_auto_allocate_chunk_size; } void set_auto_allocate_chunk_size(Optional<u32> value) { m_auto_allocate_chunk_size = value; } diff --git a/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.idl b/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.idl index 923a2238d3..71def45329 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.idl +++ b/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.idl @@ -6,8 +6,8 @@ interface ReadableByteStreamController { readonly attribute unrestricted double? desiredSize; undefined close(); + undefined error(optional any e); // FIXME: Implement // undefined enqueue(ArrayBufferView chunk); - // undefined error(optional any e); }; |