From 1f4c7ac62b3b738a2cab2ab2054eb00aee88087d Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Fri, 10 Jan 2025 16:12:34 +1300 Subject: [PATCH] LibWeb/DOM: Remove uneccessary ExceptionOr for NodeIterator::create --- Libraries/LibWeb/DOM/Document.cpp | 2 +- Libraries/LibWeb/DOM/NodeIterator.cpp | 2 +- Libraries/LibWeb/DOM/NodeIterator.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 1deb7d0aaac..77c1ee670d6 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -3336,7 +3336,7 @@ WebIDL::ExceptionOr Document::validate_qualified_nam // https://dom.spec.whatwg.org/#dom-document-createnodeiterator GC::Ref Document::create_node_iterator(Node& root, unsigned what_to_show, GC::Ptr filter) { - return NodeIterator::create(realm(), root, what_to_show, filter).release_value_but_fixme_should_propagate_errors(); + return NodeIterator::create(realm(), root, what_to_show, filter); } // https://dom.spec.whatwg.org/#dom-document-createtreewalker diff --git a/Libraries/LibWeb/DOM/NodeIterator.cpp b/Libraries/LibWeb/DOM/NodeIterator.cpp index 49133cecfe4..c2be4dd617a 100644 --- a/Libraries/LibWeb/DOM/NodeIterator.cpp +++ b/Libraries/LibWeb/DOM/NodeIterator.cpp @@ -48,7 +48,7 @@ void NodeIterator::visit_edges(Cell::Visitor& visitor) } // https://dom.spec.whatwg.org/#dom-document-createnodeiterator -WebIDL::ExceptionOr> NodeIterator::create(JS::Realm& realm, Node& root, unsigned what_to_show, GC::Ptr filter) +GC::Ref NodeIterator::create(JS::Realm& realm, Node& root, unsigned what_to_show, GC::Ptr filter) { // 1. Let iterator be a new NodeIterator object. // 2. Set iterator’s root and iterator’s reference to root. diff --git a/Libraries/LibWeb/DOM/NodeIterator.h b/Libraries/LibWeb/DOM/NodeIterator.h index 71a66bf2608..c22309b8aa2 100644 --- a/Libraries/LibWeb/DOM/NodeIterator.h +++ b/Libraries/LibWeb/DOM/NodeIterator.h @@ -17,7 +17,7 @@ class NodeIterator final : public Bindings::PlatformObject { GC_DECLARE_ALLOCATOR(NodeIterator); public: - static WebIDL::ExceptionOr> create(JS::Realm& realm, Node& root, unsigned what_to_show, GC::Ptr); + static GC::Ref create(JS::Realm& realm, Node& root, unsigned what_to_show, GC::Ptr); virtual ~NodeIterator() override;