mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibJS: Convert to_double() to ThrowCompletionOr
This commit is contained in:
parent
51c33b3b35
commit
1639ed7e0a
Notes:
sideshowbarker
2024-07-18 02:17:22 +09:00
Author: https://github.com/IdanHo
Commit: 1639ed7e0a
Pull-request: https://github.com/SerenityOS/serenity/pull/10504
Reviewed-by: https://github.com/linusg
10 changed files with 23 additions and 40 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue