diff options
Diffstat (limited to 'Tests/LibWasm/test-wasm.cpp')
-rw-r--r-- | Tests/LibWasm/test-wasm.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Tests/LibWasm/test-wasm.cpp b/Tests/LibWasm/test-wasm.cpp index 0ecd294ec6..ecd89f8932 100644 --- a/Tests/LibWasm/test-wasm.cpp +++ b/Tests/LibWasm/test-wasm.cpp @@ -190,6 +190,12 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::wasm_invoke) case Wasm::ValueType::Kind::ExternReference: arguments.append(Wasm::Value(Wasm::ExternAddress { static_cast<u64>(value) })); break; + case Wasm::ValueType::Kind::NullFunctionReference: + arguments.append(Wasm::Value(Wasm::Value::Null { Wasm::ValueType(Wasm::ValueType::Kind::FunctionReference) })); + break; + case Wasm::ValueType::Kind::NullExternReference: + arguments.append(Wasm::Value(Wasm::Value::Null { Wasm::ValueType(Wasm::ValueType::Kind::ExternReference) })); + break; } } @@ -206,6 +212,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::wasm_invoke) result.values().first().value().visit( [&](const auto& value) { return_value = JS::Value(static_cast<double>(value)); }, [&](const Wasm::FunctionAddress& index) { return_value = JS::Value(static_cast<double>(index.value())); }, - [&](const Wasm::ExternAddress& index) { return_value = JS::Value(static_cast<double>(index.value())); }); + [&](const Wasm::ExternAddress& index) { return_value = JS::Value(static_cast<double>(index.value())); }, + [&](const Wasm::Value::Null&) { return_value = JS::js_null(); }); return return_value; } |