mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 13:27:35 +00:00
LibWeb: Convert URL to use TRY for error propagation
This commit is contained in:
parent
2219eef250
commit
cd6896d343
1 changed files with 2 additions and 3 deletions
|
@ -35,10 +35,9 @@ DOM::ExceptionOr<NonnullRefPtr<URL>> URL::create_with_global_object(Bindings::Wi
|
||||||
auto& query = parsed_url.query().is_null() ? String::empty() : parsed_url.query();
|
auto& query = parsed_url.query().is_null() ? String::empty() : parsed_url.query();
|
||||||
// 6. Set this’s URL to parsedURL.
|
// 6. Set this’s URL to parsedURL.
|
||||||
// 7. Set this’s query object to a new URLSearchParams object.
|
// 7. Set this’s query object to a new URLSearchParams object.
|
||||||
auto query_object = URLSearchParams::create_with_global_object(window_object, query);
|
auto query_object = MUST(URLSearchParams::create_with_global_object(window_object, query));
|
||||||
VERIFY(!query_object.is_exception()); // The string variant of the constructor can't throw.
|
|
||||||
// 8. Initialize this’s query object with query.
|
// 8. Initialize this’s query object with query.
|
||||||
auto result_url = URL::create(move(parsed_url), query_object.release_value());
|
auto result_url = URL::create(move(parsed_url), move(query_object));
|
||||||
// 9. Set this’s query object’s URL object to this.
|
// 9. Set this’s query object’s URL object to this.
|
||||||
result_url->m_query->m_url = result_url;
|
result_url->m_query->m_url = result_url;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue