mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibWeb: Change Fetch's ProcessBodyError to accept a plain JS value
This callback is meant to be triggered by streams, which does not always provide a WebIDL::DOMException. Pass a plain value instead. Of all the users of this callback, only one actually uses the value, and already converts the DOMException to a plain value.
This commit is contained in:
parent
fb9c8324d9
commit
b5ba60f1d1
Notes:
sideshowbarker
2024-07-17 06:39:26 +09:00
Author: https://github.com/trflynn89
Commit: b5ba60f1d1
Pull-request: https://github.com/SerenityOS/serenity/pull/24132
Reviewed-by: https://github.com/kennethmyhra
Reviewed-by: https://github.com/shannonbooth
9 changed files with 14 additions and 14 deletions
|
@ -93,7 +93,7 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_markdown_docume
|
|||
parser->run(url);
|
||||
});
|
||||
|
||||
auto process_body_error = JS::create_heap_function(realm.heap(), [](JS::GCPtr<WebIDL::DOMException>) {
|
||||
auto process_body_error = JS::create_heap_function(realm.heap(), [](JS::Value) {
|
||||
dbgln("FIXME: Load html page with an error if read of body failed.");
|
||||
});
|
||||
|
||||
|
@ -168,7 +168,7 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_html_document(H
|
|||
});
|
||||
});
|
||||
|
||||
auto process_body_error = JS::create_heap_function(document->heap(), [](JS::GCPtr<WebIDL::DOMException>) {
|
||||
auto process_body_error = JS::create_heap_function(document->heap(), [](JS::Value) {
|
||||
dbgln("FIXME: Load html page with an error if read of body failed.");
|
||||
});
|
||||
|
||||
|
@ -259,7 +259,7 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_xml_document(HT
|
|||
}
|
||||
});
|
||||
|
||||
auto process_body_error = JS::create_heap_function(document->heap(), [](JS::GCPtr<WebIDL::DOMException>) {
|
||||
auto process_body_error = JS::create_heap_function(document->heap(), [](JS::Value) {
|
||||
dbgln("FIXME: Load html page with an error if read of body failed.");
|
||||
});
|
||||
|
||||
|
@ -322,7 +322,7 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_text_document(H
|
|||
MUST(title_element->append_child(*title_text));
|
||||
});
|
||||
|
||||
auto process_body_error = JS::create_heap_function(document->heap(), [](JS::GCPtr<WebIDL::DOMException>) {
|
||||
auto process_body_error = JS::create_heap_function(document->heap(), [](JS::Value) {
|
||||
dbgln("FIXME: Load html page with an error if read of body failed.");
|
||||
});
|
||||
|
||||
|
@ -418,7 +418,7 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_media_document(
|
|||
navigation_params.response->body()->fully_read(
|
||||
realm,
|
||||
JS::create_heap_function(document->heap(), [document](ByteBuffer) { HTML::HTMLParser::the_end(document); }),
|
||||
JS::create_heap_function(document->heap(), [](JS::GCPtr<WebIDL::DOMException>) {}),
|
||||
JS::create_heap_function(document->heap(), [](JS::Value) {}),
|
||||
JS::NonnullGCPtr { realm.global_object() });
|
||||
|
||||
// 9. Return document.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue