From cd2a34deb7f23bfd615599eec459d35f93377dc4 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 31 Oct 2024 12:35:14 -0400 Subject: [PATCH] LibWeb: Do not store message port objects in a plain vector --- Userland/Libraries/LibWeb/HTML/MessageEvent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp index baf10e1ada7..f09f26a2690 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp @@ -66,10 +66,10 @@ Variant, JS::Handle, Empty> MessageEvent::s JS::NonnullGCPtr MessageEvent::ports() const { if (!m_ports_array) { - Vector port_vector; - for (auto const& port : m_ports) { + JS::MarkedVector port_vector(heap()); + for (auto const& port : m_ports) port_vector.append(port); - } + m_ports_array = JS::Array::create_from(realm(), port_vector); MUST(m_ports_array->set_integrity_level(IntegrityLevel::Frozen)); }