mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02: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:
committed by
Andreas Kling
parent
3aa6ef8ac0
commit
c29916775e
Notes:
sideshowbarker
2024-07-17 01:51:00 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/c29916775e Pull-request: https://github.com/SerenityOS/serenity/pull/24165 Reviewed-by: https://github.com/kennethmyhra ✅ Reviewed-by: https://github.com/shannonbooth ✅
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user