mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibJS: Convert to_double() to ThrowCompletionOr
This commit is contained in:
committed by
Linus Groh
parent
51c33b3b35
commit
1639ed7e0a
@@ -403,15 +403,11 @@ Optional<Wasm::Value> to_webassembly_value(JS::Value value, const Wasm::ValueTyp
|
||||
return Wasm::Value { static_cast<i32>(_i32) };
|
||||
}
|
||||
case Wasm::ValueType::F64: {
|
||||
auto number = value.to_double(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto number = TRY_OR_DISCARD(value.to_double(global_object));
|
||||
return Wasm::Value { static_cast<double>(number) };
|
||||
}
|
||||
case Wasm::ValueType::F32: {
|
||||
auto number = value.to_double(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto number = TRY_OR_DISCARD(value.to_double(global_object));
|
||||
return Wasm::Value { static_cast<float>(number) };
|
||||
}
|
||||
case Wasm::ValueType::FunctionReference:
|
||||
|
||||
Reference in New Issue
Block a user