mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
LibWeb: Replace GlobalObject with VM in WebAssembly AOs [Part 1/4]
This commit is contained in:
parent
40a70461a0
commit
5f1fe4b012
7 changed files with 34 additions and 37 deletions
|
@ -27,6 +27,8 @@ void WebAssemblyInstanceObject::initialize(JS::Realm& realm)
|
|||
{
|
||||
Object::initialize(realm);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
VERIFY(!m_exports_object);
|
||||
m_exports_object = create(realm, nullptr);
|
||||
auto& instance = this->instance();
|
||||
|
@ -36,7 +38,7 @@ void WebAssemblyInstanceObject::initialize(JS::Realm& realm)
|
|||
[&](Wasm::FunctionAddress const& address) {
|
||||
Optional<JS::FunctionObject*> object = cache.function_instances.get(address);
|
||||
if (!object.has_value()) {
|
||||
object = create_native_function(realm.global_object(), address, export_.name());
|
||||
object = create_native_function(vm, address, export_.name());
|
||||
cache.function_instances.set(address, *object);
|
||||
}
|
||||
m_exports_object->define_direct_property(export_.name(), *object, JS::default_attributes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue