mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Refactor WebAssembly API to use spec-defined promise AOs
This commit is contained in:
parent
3504370281
commit
ba6dcd7521
Notes:
github-actions[bot]
2024-11-01 17:43:26 +00:00
Author: https://github.com/ADKaster
Commit: ba6dcd7521
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1982
6 changed files with 278 additions and 142 deletions
|
@ -21,14 +21,13 @@ namespace Web::WebAssembly {
|
|||
|
||||
JS_DEFINE_ALLOCATOR(Instance);
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Instance>> Instance::construct_impl(JS::Realm& realm, Module& module, Optional<JS::Handle<JS::Object>>& import_object)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Instance>> Instance::construct_impl(JS::Realm& realm, Module& module, Optional<JS::Handle<JS::Object>>& import_object_handle)
|
||||
{
|
||||
// FIXME: Implement the importObject parameter.
|
||||
(void)import_object;
|
||||
JS::GCPtr<JS::Object> import_object = import_object_handle.has_value() ? import_object_handle.value().ptr() : nullptr;
|
||||
|
||||
auto& vm = realm.vm();
|
||||
|
||||
auto module_instance = TRY(Detail::instantiate_module(vm, module.compiled_module()->module));
|
||||
auto module_instance = TRY(Detail::instantiate_module(vm, module.compiled_module()->module, import_object));
|
||||
return vm.heap().allocate<Instance>(realm, realm, move(module_instance));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue