From 9efcc013873a9d23f6309c7d04e0e181f9420c22 Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Fri, 7 Jul 2023 16:28:39 +0200 Subject: [PATCH] LibWeb: Add AO transform_stream_default_controller_error() --- Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp | 9 +++++++++ Userland/Libraries/LibWeb/Streams/AbstractOperations.h | 1 + 2 files changed, 10 insertions(+) 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);