diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2023-02-26 16:09:02 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-15 08:48:49 +0100 |
commit | 7c0c1c8f4969abeec1436346f29081b3afbcdeab (patch) | |
tree | 985c294882161720a82dc54c70d0680e29700ec9 /Userland/Libraries/LibWeb/URL | |
parent | 1df3652e272e1aa69b3a1f8d1730ec464242ada9 (diff) | |
download | serenity-7c0c1c8f4969abeec1436346f29081b3afbcdeab.zip |
LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibWeb/URL')
-rw-r--r-- | Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp index 4783dd0eb6..0e83251970 100644 --- a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp +++ b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp @@ -48,15 +48,15 @@ JS::ThrowCompletionOr<void> URLSearchParamsIterator::initialize(JS::Realm& realm void URLSearchParamsIterator::visit_edges(JS::Cell::Visitor& visitor) { Base::visit_edges(visitor); - visitor.visit(&m_url_search_params); + visitor.visit(m_url_search_params); } JS::Object* URLSearchParamsIterator::next() { - if (m_index >= m_url_search_params.m_list.size()) + if (m_index >= m_url_search_params->m_list.size()) return create_iterator_result_object(vm(), JS::js_undefined(), true); - auto& entry = m_url_search_params.m_list[m_index++]; + auto& entry = m_url_search_params->m_list[m_index++]; if (m_iteration_kind == JS::Object::PropertyKind::Key) return create_iterator_result_object(vm(), JS::PrimitiveString::create(vm(), entry.name), false); else if (m_iteration_kind == JS::Object::PropertyKind::Value) diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h index 198ff2d0ef..08d7fd6d1b 100644 --- a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h +++ b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h @@ -27,7 +27,7 @@ private: virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; - URLSearchParams const& m_url_search_params; + JS::NonnullGCPtr<URLSearchParams const> m_url_search_params; JS::Object::PropertyKind m_iteration_kind; size_t m_index { 0 }; }; |