mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: No longer return undefined
on null table entry in Wasm API
Return `null` instead, as per the specification.
This commit is contained in:
parent
93216a875e
commit
3c5e3eef10
Notes:
github-actions[bot]
2024-07-30 21:44:36 +00:00
Author: https://github.com/dzfrias
Commit: 3c5e3eef10
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/909
Reviewed-by: https://github.com/alimpfard
2 changed files with 4 additions and 3 deletions
|
@ -450,7 +450,10 @@ JS::Value to_js_value(JS::VM& vm, Wasm::Value& wasm_value)
|
|||
case Wasm::ValueType::F32:
|
||||
return JS::Value(static_cast<double>(wasm_value.to<float>().value()));
|
||||
case Wasm::ValueType::FunctionReference: {
|
||||
auto address = wasm_value.to<Wasm::Reference::Func>().value().address;
|
||||
auto ref_ = *wasm_value.to<Wasm::Reference>();
|
||||
if (ref_.ref().has<Wasm::Reference::Null>())
|
||||
return JS::js_null();
|
||||
auto address = ref_.ref().get<Wasm::Reference::Func>().address;
|
||||
auto& cache = get_cache(realm);
|
||||
auto* function = cache.abstract_machine().store().get(address);
|
||||
auto name = function->visit(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue