LibWeb: Do not store resize observer sizes in a plain vector

This commit is contained in:
Timothy Flynn 2024-10-31 12:23:09 -04:00 committed by Alexander Kalenik
parent 04648d93d4
commit d5c3a0e53a
Notes: github-actions[bot] 2024-10-31 23:37:23 +00:00

View file

@ -76,9 +76,10 @@ void ResizeObserverEntry::visit_edges(JS::Cell::Visitor& visitor)
static JS::NonnullGCPtr<JS::Object> to_js_array(JS::Realm& realm, Vector<JS::NonnullGCPtr<ResizeObserverSize>> const& sizes)
{
Vector<JS::Value> vector;
JS::MarkedVector<JS::Value> vector(realm.heap());
for (auto const& size : sizes)
vector.append(JS::Value(size.ptr()));
auto array = JS::Array::create_from(realm, vector);
MUST(array->set_integrity_level(JS::Object::IntegrityLevel::Frozen));
return array;