LibWasm+LibWeb: Implement (a very basic version of) the JS link/import

This allows Wasm code to call javascript functions.
This commit is contained in:
Ali Mohammad Pur 2021-05-17 12:29:44 +04:30 committed by Ali Mohammad Pur
commit 3926eab3b7
Notes: sideshowbarker 2024-07-18 17:23:28 +09:00
6 changed files with 113 additions and 39 deletions

View file

@ -21,10 +21,10 @@ Optional<FunctionAddress> Store::allocate(ModuleInstance& module, const Module::
return address;
}
Optional<FunctionAddress> Store::allocate(const HostFunction& function)
Optional<FunctionAddress> Store::allocate(HostFunction&& function)
{
FunctionAddress address { m_functions.size() };
m_functions.empend(HostFunction { function });
m_functions.empend(HostFunction { move(function) });
return address;
}