mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
LibWeb: Mark writable stream abort steps as infallible
These don't throw. We can remove a decent amount of exception handling by marking them infallible.
This commit is contained in:
committed by
Andreas Kling
parent
fc070c8cbd
commit
9d5e538247
Notes:
sideshowbarker
2024-07-17 03:00:02 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/9d5e538247 Pull-request: https://github.com/SerenityOS/serenity/pull/24165 Reviewed-by: https://github.com/kennethmyhra ✅ Reviewed-by: https://github.com/shannonbooth ✅
@@ -27,21 +27,21 @@ void WritableStreamDefaultController::visit_edges(Visitor& visitor)
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#ws-default-controller-error
|
||||
WebIDL::ExceptionOr<void> WritableStreamDefaultController::error(JS::Value error)
|
||||
void WritableStreamDefaultController::error(JS::Value error)
|
||||
{
|
||||
// 1. Let state be this.[[stream]].[[state]].
|
||||
auto state = m_stream->state();
|
||||
|
||||
// 2. If state is not "writable", return.
|
||||
if (state != WritableStream::State::Writable)
|
||||
return {};
|
||||
return;
|
||||
|
||||
// 3. Perform ! WritableStreamDefaultControllerError(this, e).
|
||||
return writable_stream_default_controller_error(*this, error);
|
||||
writable_stream_default_controller_error(*this, error);
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#ws-default-controller-private-abort
|
||||
WebIDL::ExceptionOr<JS::GCPtr<WebIDL::Promise>> WritableStreamDefaultController::abort_steps(JS::Value reason)
|
||||
JS::NonnullGCPtr<WebIDL::Promise> WritableStreamDefaultController::abort_steps(JS::Value reason)
|
||||
{
|
||||
// 1. Let result be the result of performing this.[[abortAlgorithm]], passing reason.
|
||||
auto result = m_abort_algorithm->function()(reason);
|
||||
|
||||
Reference in New Issue
Block a user