From 5d48ade508e07af29d186b6137c15ce3f28ad284 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Thu, 27 Apr 2023 15:28:48 +0000 Subject: [PATCH] LibWeb: Use TRY() to convert invoke_callback result to an ExceptionOr Otherwise, the JS::Completion is always interpretted as an error by ExceptionOr. --- Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp b/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp index ad42ee871d..1e265e5911 100644 --- a/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp @@ -762,7 +762,7 @@ WebIDL::ExceptionOr set_up_readable_stream_default_controller_from_underly if (underlying_source.start) { start_algorithm = [controller, underlying_source_value, callback = underlying_source.start]() -> WebIDL::ExceptionOr { // Note: callback does not return a promise, so invoke_callback may return an abrupt completion - return WebIDL::invoke_callback(*callback, underlying_source_value, controller); + return TRY(WebIDL::invoke_callback(*callback, underlying_source_value, controller)).release_value(); }; } @@ -1937,7 +1937,7 @@ WebIDL::ExceptionOr set_up_writable_stream_default_controller_from_underly if (underlying_sink.start) { start_algorithm = [controller, underlying_sink_value, callback = underlying_sink.start]() -> WebIDL::ExceptionOr { // Note: callback does not return a promise, so invoke_callback may return an abrupt completion - return WebIDL::invoke_callback(*callback, underlying_sink_value, controller); + return TRY(WebIDL::invoke_callback(*callback, underlying_sink_value, controller)).release_value(); }; }