diff options
author | Kenneth Myhra <kennethmyhra@gmail.com> | 2023-02-19 15:33:03 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-22 09:55:33 +0100 |
commit | a2381a672db518e4af9087eb382ed417e66a1a52 (patch) | |
tree | c09bfe358f418aa03a5e7f7fa36ca6fac33a7a9b /Userland/Libraries/LibWeb/Fetch | |
parent | b3734627a1684fdb3f3c1a6712b55dfefd273a0d (diff) | |
download | serenity-a2381a672db518e4af9087eb382ed417e66a1a52.zip |
LibWeb: Make factory method of Fetch::HeadersIterator fallible
Diffstat (limited to 'Userland/Libraries/LibWeb/Fetch')
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/HeadersIterator.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp index 41fdd3e0cd..b9b7c69021 100644 --- a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp +++ b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp @@ -23,9 +23,9 @@ void Intrinsics::create_web_prototype_and_constructor<HeadersIteratorPrototype>( namespace Web::Fetch { -JS::NonnullGCPtr<HeadersIterator> HeadersIterator::create(Headers const& headers, JS::Object::PropertyKind iteration_kind) +WebIDL::ExceptionOr<JS::NonnullGCPtr<HeadersIterator>> HeadersIterator::create(Headers const& headers, JS::Object::PropertyKind iteration_kind) { - return headers.heap().allocate<HeadersIterator>(headers.realm(), headers, iteration_kind).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(headers.heap().allocate<HeadersIterator>(headers.realm(), headers, iteration_kind)); } HeadersIterator::HeadersIterator(Headers const& headers, JS::Object::PropertyKind iteration_kind) diff --git a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.h b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.h index 65a5f514d1..9e68b88d6a 100644 --- a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.h +++ b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.h @@ -16,7 +16,7 @@ class HeadersIterator final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(HeadersIterator, Bindings::PlatformObject); public: - static JS::NonnullGCPtr<HeadersIterator> create(Headers const&, JS::Object::PropertyKind iteration_kind); + static WebIDL::ExceptionOr<JS::NonnullGCPtr<HeadersIterator>> create(Headers const&, JS::Object::PropertyKind iteration_kind); virtual ~HeadersIterator() override; |