mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
LibWeb: Mark most stream callbacks as infallible
There are a number of script-provided stream callbacks for various
stream operations, such as `start`, `pull`, `cancel`, etc. Out of all of
these, only the `start` callback can actually throw. And when it does,
the exception is realized immediately in the corresponding stream
constructor.
All other callbacks have spec text of the form:
Throwing an exception is treated the same as returning a rejected
promise.
And indeed this is internally handled by the streams spec. Thus all of
those callbacks can be specified as returning only a promise, rather
than a WebIDL::ExceptionOr<Promise>.
This commit is contained in:
committed by
Andreas Kling
parent
ffb48ccd81
commit
bbe6b84bd6
@@ -168,7 +168,9 @@ WebIDL::ExceptionOr<void> ReadableByteStreamController::pull_steps(JS::NonnullGC
|
||||
readable_stream_add_read_request(*m_stream, read_request);
|
||||
|
||||
// 7. Perform ! ReadableByteStreamControllerCallPullIfNeeded(this).
|
||||
return readable_byte_stream_controller_call_pull_if_needed(*this);
|
||||
readable_byte_stream_controller_call_pull_if_needed(*this);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#rbs-controller-private-pull
|
||||
|
||||
Reference in New Issue
Block a user