summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2023-02-19 13:11:31 +0100
committerAndreas Kling <kling@serenityos.org>2023-02-22 09:55:33 +0100
commitb3734627a1684fdb3f3c1a6712b55dfefd273a0d (patch)
treed24f9a61e8ee94c0adda3d181b9b5ba2439e95ae
parente776171d8ffc9e883e34acb1d797f73935300a60 (diff)
downloadserenity-b3734627a1684fdb3f3c1a6712b55dfefd273a0d.zip
LibWeb: Make factory method of URL::URLSearchParamsIterator fallible
-rw-r--r--Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp4
-rw-r--r--Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp
index 8adb432af7..4783dd0eb6 100644
--- a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp
+++ b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp
@@ -23,9 +23,9 @@ void Intrinsics::create_web_prototype_and_constructor<URLSearchParamsIteratorPro
namespace Web::URL {
-JS::NonnullGCPtr<URLSearchParamsIterator> URLSearchParamsIterator::create(URLSearchParams const& url_search_params, JS::Object::PropertyKind iteration_kind)
+WebIDL::ExceptionOr<JS::NonnullGCPtr<URLSearchParamsIterator>> URLSearchParamsIterator::create(URLSearchParams const& url_search_params, JS::Object::PropertyKind iteration_kind)
{
- return url_search_params.heap().allocate<URLSearchParamsIterator>(url_search_params.realm(), url_search_params, iteration_kind).release_allocated_value_but_fixme_should_propagate_errors();
+ return MUST_OR_THROW_OOM(url_search_params.heap().allocate<URLSearchParamsIterator>(url_search_params.realm(), url_search_params, iteration_kind));
}
URLSearchParamsIterator::URLSearchParamsIterator(URLSearchParams const& url_search_params, JS::Object::PropertyKind iteration_kind)
diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h
index 324c55253b..198ff2d0ef 100644
--- a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h
+++ b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h
@@ -15,7 +15,7 @@ class URLSearchParamsIterator : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(URLSearchParamsIterator, Bindings::PlatformObject);
public:
- static JS::NonnullGCPtr<URLSearchParamsIterator> create(URLSearchParams const&, JS::Object::PropertyKind iteration_kind);
+ static WebIDL::ExceptionOr<JS::NonnullGCPtr<URLSearchParamsIterator>> create(URLSearchParams const&, JS::Object::PropertyKind iteration_kind);
virtual ~URLSearchParamsIterator() override;