diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-16 21:52:16 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-17 12:12:35 +0100 |
commit | e87cea8248115dd035ee91f56c1853d2391b84c0 (patch) | |
tree | df438fcd2eca3b92600c9b9f242943b94b8fe978 /Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp | |
parent | b8f101888bf5cc16f7074266bf16ebde4744f452 (diff) | |
download | serenity-e87cea8248115dd035ee91f56c1853d2391b84c0.zip |
LibJS: Convert to_bigint() to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp')
-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 699dc19690..4fbfddbec9 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -388,9 +388,7 @@ Optional<Wasm::Value> to_webassembly_value(JS::Value value, const Wasm::ValueTyp switch (type.kind()) { case Wasm::ValueType::I64: { - auto bigint = value.to_bigint(global_object); - if (vm.exception()) - return {}; + auto bigint = TRY_OR_DISCARD(value.to_bigint(global_object)); auto value = bigint->big_integer().divided_by(two_64).remainder; VERIFY(value.unsigned_value().trimmed_length() <= 2); i64 integer = static_cast<i64>(value.unsigned_value().to_u64()); |