LibWeb: Mark stream AOs as infallible as required by the spec

There were several instances where the spec marks an AO invocation as
infallible, but we were propagating WebIDL::ExceptionOr. These mostly
cannot throw due to knowledge about the values they are provided. By
unwinding these, we can remove a decent amount of exception handling.
This commit is contained in:
Timothy Flynn 2024-04-29 18:01:44 -04:00 committed by Andreas Kling
commit c29916775e
Notes: sideshowbarker 2024-07-17 01:51:00 +09:00
13 changed files with 77 additions and 98 deletions

View file

@ -56,21 +56,17 @@ WebIDL::ExceptionOr<void> TransformStreamDefaultController::enqueue(Optional<JS:
}
// https://streams.spec.whatwg.org/#ts-default-controller-error
WebIDL::ExceptionOr<void> TransformStreamDefaultController::error(Optional<JS::Value> reason)
void TransformStreamDefaultController::error(Optional<JS::Value> reason)
{
// 1. Perform ? TransformStreamDefaultControllerError(this, e).
TRY(transform_stream_default_controller_error(*this, reason.has_value() ? reason.value() : JS::js_undefined()));
return {};
transform_stream_default_controller_error(*this, reason.has_value() ? reason.value() : JS::js_undefined());
}
// https://streams.spec.whatwg.org/#ts-default-controller-terminate
WebIDL::ExceptionOr<void> TransformStreamDefaultController::terminate()
void TransformStreamDefaultController::terminate()
{
// 1. Perform ? TransformStreamDefaultControllerTerminate(this).
TRY(transform_stream_default_controller_terminate(*this));
return {};
transform_stream_default_controller_terminate(*this);
}
}