diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-17 23:33:35 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-18 08:01:38 +0300 |
commit | f6a5ff7b003930a1994c0f4c4a1c4b1da7c7123d (patch) | |
tree | 0a7cce77a5d3f9f81444ffb22047b4944e8be28d /Userland/Libraries/LibWeb/WebAssembly | |
parent | 20d990563cf858d51d4c6bf93a7c37317c5ecd12 (diff) | |
download | serenity-f6a5ff7b003930a1994c0f4c4a1c4b1da7c7123d.zip |
LibJS: Convert to_i32() to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibWeb/WebAssembly')
-rw-r--r-- | Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index 2b49e3b74d..51e21fbdde 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -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: { |