mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +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
|
@ -49,12 +49,12 @@ WebIDL::ExceptionOr<Infrastructure::BodyWithType> extract_body(JS::Realm& realm,
|
|||
}
|
||||
// 3. Otherwise, if object is a Blob object, set stream to the result of running object’s get stream.
|
||||
else if (auto const* blob_handle = object.get_pointer<JS::Handle<FileAPI::Blob>>()) {
|
||||
stream = TRY(blob_handle->cell()->get_stream());
|
||||
stream = blob_handle->cell()->get_stream();
|
||||
}
|
||||
// 4. Otherwise, set stream to a new ReadableStream object, and set up stream with byte reading support.
|
||||
else {
|
||||
stream = realm.heap().allocate<Streams::ReadableStream>(realm, realm);
|
||||
TRY(Streams::set_up_readable_stream_controller_with_byte_reading_support(*stream));
|
||||
Streams::set_up_readable_stream_controller_with_byte_reading_support(*stream);
|
||||
}
|
||||
|
||||
// 5. Assert: stream is a ReadableStream object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue