Skip to content

Commit

Permalink
Fixed errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Jul 15, 2021
1 parent a2bae12 commit 7195a9c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ edition = "2018"
proc-macro = true

[features]
default-features = []
# It will make imports from `wasmer_js::` instead of `wasmer::`
js = []

Expand Down
3 changes: 1 addition & 2 deletions lib/js-api/src/externals/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions lib/js-api/src/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
}
Expand Down Expand Up @@ -160,7 +160,7 @@ impl From<JsValue> 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)),
})
}
Expand Down

0 comments on commit 7195a9c

Please sign in to comment.