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

@ -74,9 +74,25 @@ private:
class Value {
public:
Value()
explicit Value(ValueType type)
: m_value(u128())
{
switch (type.kind()) {
case ValueType::I32:
case ValueType::I64:
case ValueType::F32:
case ValueType::F64:
case ValueType::V128:
break;
case ValueType::FunctionReference:
// ref.null funcref
m_value = u128(0, 2);
break;
case ValueType::ExternReference:
// ref.null externref
m_value = u128(0, 3);
break;
}
}
template<typename T>