mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibWasm: Remove Wasm::ValueType::Kind::Null*
variants
As far as I know, they're not in the spec and don't serve any purposes in the internals of LibWasm.
This commit is contained in:
parent
509c10d14d
commit
5382fbb617
Notes:
sideshowbarker
2024-07-17 20:58:35 +09:00
Author: https://github.com/dzfrias
Commit: 5382fbb617
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/500
4 changed files with 4 additions and 29 deletions
|
@ -412,10 +412,9 @@ JS::ThrowCompletionOr<Wasm::Value> to_webassembly_value(JS::VM& vm, JS::Value va
|
|||
auto number = TRY(value.to_double(vm));
|
||||
return Wasm::Value { static_cast<float>(number) };
|
||||
}
|
||||
case Wasm::ValueType::FunctionReference:
|
||||
case Wasm::ValueType::NullFunctionReference: {
|
||||
case Wasm::ValueType::FunctionReference: {
|
||||
if (value.is_null())
|
||||
return Wasm::Value { Wasm::ValueType(Wasm::ValueType::NullExternReference), 0ull };
|
||||
return Wasm::Value { Wasm::ValueType(Wasm::ValueType::FunctionReference), 0ull };
|
||||
|
||||
if (value.is_function()) {
|
||||
auto& function = value.as_function();
|
||||
|
@ -429,7 +428,6 @@ JS::ThrowCompletionOr<Wasm::Value> to_webassembly_value(JS::VM& vm, JS::Value va
|
|||
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "Exported function");
|
||||
}
|
||||
case Wasm::ValueType::ExternReference:
|
||||
case Wasm::ValueType::NullExternReference:
|
||||
TODO();
|
||||
case Wasm::ValueType::V128:
|
||||
return vm.throw_completion<JS::TypeError>("Cannot convert a vector value to a javascript value"sv);
|
||||
|
@ -453,11 +451,8 @@ JS::Value to_js_value(JS::VM& vm, Wasm::Value& wasm_value)
|
|||
case Wasm::ValueType::FunctionReference:
|
||||
// FIXME: What's the name of a function reference that isn't exported?
|
||||
return create_native_function(vm, wasm_value.to<Wasm::Reference::Func>().value().address, "FIXME_IHaveNoIdeaWhatThisShouldBeCalled");
|
||||
case Wasm::ValueType::NullFunctionReference:
|
||||
return JS::js_null();
|
||||
case Wasm::ValueType::V128:
|
||||
case Wasm::ValueType::ExternReference:
|
||||
case Wasm::ValueType::NullExternReference:
|
||||
TODO();
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue