mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
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:
parent
a2af04837e
commit
3926eab3b7
6 changed files with 113 additions and 39 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue