From 7195a9c3f0911c7dc97831674802db4b28078def Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Wed, 14 Jul 2021 22:17:35 -0700 Subject: [PATCH] Fixed errors and warnings --- lib/derive/Cargo.toml | 1 - lib/js-api/src/externals/function.rs | 3 +-- lib/js-api/src/trap.rs | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/derive/Cargo.toml b/lib/derive/Cargo.toml index 8c7dd6d52d3..53aefdbacd3 100644 --- a/lib/derive/Cargo.toml +++ b/lib/derive/Cargo.toml @@ -11,7 +11,6 @@ edition = "2018" proc-macro = true [features] -default-features = [] # It will make imports from `wasmer_js::` instead of `wasmer::` js = [] diff --git a/lib/js-api/src/externals/function.rs b/lib/js-api/src/externals/function.rs index 2ac8b640511..8cbbac6df3e 100644 --- a/lib/js-api/src/externals/function.rs +++ b/lib/js-api/src/externals/function.rs @@ -462,8 +462,7 @@ impl Function { arr.set(i as u32, js_value); } let result = - js_sys::Reflect::apply(&self.exported.function, &wasm_bindgen::JsValue::NULL, &arr) - .unwrap(); + js_sys::Reflect::apply(&self.exported.function, &wasm_bindgen::JsValue::NULL, &arr)?; let result_types = self.exported.ty.results(); match result_types.len() { diff --git a/lib/js-api/src/trap.rs b/lib/js-api/src/trap.rs index cdb07377f6f..588a91bf8df 100644 --- a/lib/js-api/src/trap.rs +++ b/lib/js-api/src/trap.rs @@ -63,7 +63,7 @@ impl RuntimeError { } /// Creates a new user `RuntimeError` with the given `error`. - pub fn user(error: impl Error + 'static) -> Self { + pub fn user(error: impl Error + Send + Sync + 'static) -> Self { RuntimeError { inner: Arc::new(RuntimeErrorSource::User(Box::new(error))), } @@ -160,7 +160,7 @@ impl From for RuntimeError { // We try to downcast the error and see if it's // an instance of RuntimeError instead, so we don't need // to re-wrap it. - generic_of_jsval(original, "RuntimeError").unwrap_or_else(|js| RuntimeError { + generic_of_jsval(original, "WasmerRuntimeError").unwrap_or_else(|js| RuntimeError { inner: Arc::new(RuntimeErrorSource::Js(js)), }) }