mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-16 16:12:53 +00:00
LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the most used AO of all of them. Definitely worth it though.
This commit is contained in:
parent
9b6c09e2c4
commit
b7e5f08e56
Notes:
sideshowbarker
2024-07-18 03:07:41 +09:00
Author: https://github.com/linusg
Commit: b7e5f08e56
Pull-request: https://github.com/SerenityOS/serenity/pull/10327
Reviewed-by: https://github.com/IdanHo ✅
61 changed files with 326 additions and 686 deletions
|
@ -164,16 +164,18 @@ Result<size_t, JS::Value> WebAssemblyObject::instantiate_module(Wasm::Module con
|
|||
dbgln("Trying to resolve stuff because import object was specified");
|
||||
for (const Wasm::Linker::Name& import_name : linker.unresolved_imports()) {
|
||||
dbgln("Trying to resolve {}::{}", import_name.module, import_name.name);
|
||||
auto value = import_object->get(import_name.module);
|
||||
if (vm.exception())
|
||||
auto value_or_error = import_object->get(import_name.module);
|
||||
if (value_or_error.is_error())
|
||||
break;
|
||||
auto value = value_or_error.release_value();
|
||||
auto object = value.to_object(global_object);
|
||||
if (vm.exception())
|
||||
break;
|
||||
|
||||
auto import_ = object->get(import_name.name);
|
||||
if (vm.exception())
|
||||
auto import_or_error = object->get(import_name.name);
|
||||
if (import_or_error.is_error())
|
||||
break;
|
||||
auto import_ = import_or_error.release_value();
|
||||
import_name.type.visit(
|
||||
[&](Wasm::TypeIndex index) {
|
||||
dbgln("Trying to resolve a function {}::{}, type index {}", import_name.module, import_name.name, index.value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue