mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00: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
@@ -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