mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
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:
parent
3aa6ef8ac0
commit
c29916775e
Notes:
sideshowbarker
2024-07-17 01:51:00 +09:00
Author: https://github.com/trflynn89
Commit: c29916775e
Pull-request: https://github.com/SerenityOS/serenity/pull/24165
Reviewed-by: https://github.com/kennethmyhra ✅
Reviewed-by: https://github.com/shannonbooth ✅
13 changed files with 77 additions and 98 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue