LibWasm+LibWeb: Allow tables to have externrefs in the JS API

This commit is contained in:
Diego Frias 2024-08-17 15:40:21 -07:00 committed by Ali Mohammad Pur
commit 4e7d3026d2
Notes: github-actions[bot] 2024-08-18 21:36:13 +00:00
8 changed files with 56 additions and 13 deletions

View file

@ -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);
}