diff options
author | davidot <davidot@serenityos.org> | 2022-02-07 15:14:31 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-02-08 09:12:42 +0000 |
commit | 1c4c251be34d4c94bc07adcd70a336558ed627d9 (patch) | |
tree | bd7692ce38d2bc57bced835fe9e1e33f82338089 /Userland/Libraries/LibWeb/WebAssembly | |
parent | 9264f9d24e10c3ca8d522450bc9152e69cbd6cda (diff) | |
download | serenity-1c4c251be34d4c94bc07adcd70a336558ed627d9.zip |
LibJS+Everywhere: Remove all VM::clear_exception() calls
Since VM::exception() no longer exists this is now useless. All of these
calls to clear_exception were just to clear the VM state after some
(potentially) failed evaluation and did not use the exception itself.
Diffstat (limited to 'Userland/Libraries/LibWeb/WebAssembly')
-rw-r--r-- | Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index 929ca881e6..b875626d43 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -159,10 +159,9 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyObject::compile) // FIXME: This shouldn't block! auto buffer_or_error = vm.argument(0).to_object(global_object); JS::Value rejection_value; - if (buffer_or_error.is_error()) { + if (buffer_or_error.is_error()) rejection_value = *buffer_or_error.throw_completion().value(); - vm.clear_exception(); - } + auto promise = JS::Promise::create(global_object); if (!rejection_value.is_empty()) { promise->reject(rejection_value); @@ -217,7 +216,6 @@ JS::ThrowCompletionOr<size_t> WebAssemblyObject::instantiate_module(Wasm::Module auto result_or_error = JS::call(global_object, function, JS::js_undefined(), move(argument_values)); if (result_or_error.is_error()) { - vm.clear_exception(); return Wasm::Trap(); } if (type.results().is_empty()) @@ -325,7 +323,6 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyObject::instantiate) bool should_return_module = false; if (buffer_or_error.is_error()) { auto rejection_value = *buffer_or_error.throw_completion().value(); - vm.clear_exception(); promise->reject(rejection_value); return promise; } |