summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2023-04-27 15:28:48 +0000
committerAndreas Kling <kling@serenityos.org>2023-05-27 13:55:14 +0200
commit5d48ade508e07af29d186b6137c15ce3f28ad284 (patch)
tree39fddb2bd3b8fec10f4957db92fb0575d544973d
parente5ff777b48dfaa0ab8a98cb4dc76809b3f1ca91c (diff)
downloadserenity-5d48ade508e07af29d186b6137c15ce3f28ad284.zip
LibWeb: Use TRY() to convert invoke_callback result to an ExceptionOr
Otherwise, the JS::Completion is always interpretted as an error by ExceptionOr.
-rw-r--r--Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp4
1 files 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<void> set_up_readable_stream_default_controller_from_underly
if (underlying_source.start) {
start_algorithm = [controller, underlying_source_value, callback = underlying_source.start]() -> WebIDL::ExceptionOr<JS::Value> {
// 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<void> set_up_writable_stream_default_controller_from_underly
if (underlying_sink.start) {
start_algorithm = [controller, underlying_sink_value, callback = underlying_sink.start]() -> WebIDL::ExceptionOr<JS::Value> {
// 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();
};
}