mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
LibWasm+LibWeb: Allow tables to have externrefs in the JS API
This commit is contained in:
parent
fc83653f3c
commit
4e7d3026d2
Notes:
github-actions[bot]
2024-08-18 21:36:13 +00:00
Author: https://github.com/dzfrias
Commit: 4e7d3026d2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1105
Reviewed-by: https://github.com/alimpfard
8 changed files with 56 additions and 13 deletions
|
@ -31,8 +31,8 @@ static Wasm::ValueType table_kind_to_value_type(Bindings::TableKind kind)
|
|||
|
||||
static JS::ThrowCompletionOr<Wasm::Value> value_to_reference(JS::VM& vm, JS::Value value, Wasm::ValueType const& reference_type)
|
||||
{
|
||||
if (value.is_undefined())
|
||||
return Wasm::Value();
|
||||
if (value.is_undefined() && reference_type.kind() != Wasm::ValueType::Kind::ExternReference)
|
||||
return Wasm::Value(reference_type);
|
||||
return Detail::to_webassembly_value(vm, value, reference_type);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue