mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
LibJS: Convert to_i32() to ThrowCompletionOr
This commit is contained in:
parent
20d990563c
commit
f6a5ff7b00
11 changed files with 47 additions and 61 deletions
|
@ -397,9 +397,7 @@ Optional<Wasm::Value> to_webassembly_value(JS::Value value, const Wasm::ValueTyp
|
|||
return Wasm::Value { integer };
|
||||
}
|
||||
case Wasm::ValueType::I32: {
|
||||
auto _i32 = value.to_i32(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto _i32 = TRY_OR_DISCARD(value.to_i32(global_object));
|
||||
return Wasm::Value { static_cast<i32>(_i32) };
|
||||
}
|
||||
case Wasm::ValueType::F64: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue