mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibWeb: Make errors for missing wasm import errors slightly nicer
This commit is contained in:
committed by
Ali Mohammad Pur
parent
651c64ebac
commit
54e892b745
Notes:
github-actions[bot]
2025-12-13 08:01:28 +00:00
Author: https://github.com/alimpfard Commit: https://github.com/LadybirdBrowser/ladybird/commit/54e892b7454 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7014 Reviewed-by: https://github.com/Hendiadyoin1
@@ -253,7 +253,7 @@ JS::ThrowCompletionOr<NonnullOwnPtr<Wasm::ModuleInstance>> instantiate_module(JS
|
||||
|
||||
// 3.4.1. If IsCallable(v) is false, throw a LinkError exception.
|
||||
if (!import_.is_function())
|
||||
return vm.throw_completion<LinkError>(JS::ErrorType::NotAFunction, import_);
|
||||
return vm.throw_completion<LinkError>(JS::ErrorType::IsNotAEvaluatedFrom, import_, "function"_string, MUST(String::formatted("[wasm import object][\"{}\"]", import_name.name)));
|
||||
auto& function = import_.as_function();
|
||||
|
||||
// 3.4.2. If v has a [[FunctionAddress]] internal slot, and therefore is an Exported Function,
|
||||
|
||||
Reference in New Issue
Block a user