mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 21:45:29 +00:00
LibWasm+LibWeb: Allow tables to have externrefs in the JS API
This commit is contained in:
committed by
Ali Mohammad Pur
parent
fc83653f3c
commit
4e7d3026d2
@@ -36,6 +36,9 @@ Optional<TableAddress> Store::allocate(TableType const& type)
|
||||
{
|
||||
TableAddress address { m_tables.size() };
|
||||
Vector<Reference> elements;
|
||||
elements.ensure_capacity(type.limits().min());
|
||||
for (size_t i = 0; i < type.limits().min(); i++)
|
||||
elements.append(Wasm::Reference { Wasm::Reference::Null { type.element_type() } });
|
||||
elements.resize(type.limits().min());
|
||||
m_tables.empend(TableInstance { type, move(elements) });
|
||||
return address;
|
||||
|
||||
Reference in New Issue
Block a user