mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 01:32:14 -05:00
LibWeb: Do not store resize observer sizes in a plain vector
This commit is contained in:
parent
04648d93d4
commit
d5c3a0e53a
Notes:
github-actions[bot]
2024-10-31 23:37:23 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d5c3a0e53ab Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2088
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
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)
|
for (auto const& size : sizes)
|
||||||
vector.append(JS::Value(size.ptr()));
|
vector.append(JS::Value(size.ptr()));
|
||||||
|
|
||||||
auto array = JS::Array::create_from(realm, vector);
|
auto array = JS::Array::create_from(realm, vector);
|
||||||
MUST(array->set_integrity_level(JS::Object::IntegrityLevel::Frozen));
|
MUST(array->set_integrity_level(JS::Object::IntegrityLevel::Frozen));
|
||||||
return array;
|
return array;
|
||||||
|
|
Loading…
Reference in a new issue