diff --git a/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp b/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp index a5aa69790a..7be2cdada4 100644 --- a/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp @@ -2734,6 +2734,15 @@ void transform_stream_default_controller_clear_algorithms(TransformStreamDefault controller.set_flush_algorithm({}); } +// https://streams.spec.whatwg.org/#transform-stream-default-controller-error +WebIDL::ExceptionOr transform_stream_default_controller_error(TransformStreamDefaultController& controller, JS::Value error) +{ + // 1. Perform ! TransformStreamError(controller.[[stream]], e). + TRY(transform_stream_error(*controller.stream(), error)); + + return {}; +} + // https://streams.spec.whatwg.org/#transform-stream-error WebIDL::ExceptionOr transform_stream_error(TransformStream& stream, JS::Value error) { diff --git a/Userland/Libraries/LibWeb/Streams/AbstractOperations.h b/Userland/Libraries/LibWeb/Streams/AbstractOperations.h index 6144b63107..36ce19502e 100644 --- a/Userland/Libraries/LibWeb/Streams/AbstractOperations.h +++ b/Userland/Libraries/LibWeb/Streams/AbstractOperations.h @@ -133,6 +133,7 @@ WebIDL::ExceptionOr writable_stream_default_controller_process_write(Writa WebIDL::ExceptionOr writable_stream_default_controller_write(WritableStreamDefaultController&, JS::Value chunk, JS::Value chunk_size); void transform_stream_default_controller_clear_algorithms(TransformStreamDefaultController&); +WebIDL::ExceptionOr transform_stream_default_controller_error(TransformStreamDefaultController&, JS::Value error); WebIDL::ExceptionOr transform_stream_error(TransformStream&, JS::Value error); WebIDL::ExceptionOr transform_stream_error_writable_and_unblock_write(TransformStream&, JS::Value error); WebIDL::ExceptionOr transform_stream_set_backpressure(TransformStream&, bool backpressure);