LibWeb: Do not store message port objects in a plain vector

This commit is contained in:
Timothy Flynn 2024-10-31 12:35:14 -04:00 committed by Alexander Kalenik
parent c479ca97b6
commit cd2a34deb7
Notes: github-actions[bot] 2024-10-31 23:37:10 +00:00

View file

@ -66,10 +66,10 @@ Variant<JS::Handle<WindowProxy>, JS::Handle<MessagePort>, Empty> MessageEvent::s
JS::NonnullGCPtr<JS::Object> MessageEvent::ports() const
{
if (!m_ports_array) {
Vector<JS::Value> port_vector;
for (auto const& port : m_ports) {
JS::MarkedVector<JS::Value> 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));
}