mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-29 11:49:30 +00:00
Fixed errors and warnings
This commit is contained in:
@ -11,7 +11,6 @@ edition = "2018"
|
|||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default-features = []
|
|
||||||
# It will make imports from `wasmer_js::` instead of `wasmer::`
|
# It will make imports from `wasmer_js::` instead of `wasmer::`
|
||||||
js = []
|
js = []
|
||||||
|
|
||||||
|
3
lib/js-api/src/externals/function.rs
vendored
3
lib/js-api/src/externals/function.rs
vendored
@ -462,8 +462,7 @@ impl Function {
|
|||||||
arr.set(i as u32, js_value);
|
arr.set(i as u32, js_value);
|
||||||
}
|
}
|
||||||
let result =
|
let result =
|
||||||
js_sys::Reflect::apply(&self.exported.function, &wasm_bindgen::JsValue::NULL, &arr)
|
js_sys::Reflect::apply(&self.exported.function, &wasm_bindgen::JsValue::NULL, &arr)?;
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let result_types = self.exported.ty.results();
|
let result_types = self.exported.ty.results();
|
||||||
match result_types.len() {
|
match result_types.len() {
|
||||||
|
@ -63,7 +63,7 @@ impl RuntimeError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new user `RuntimeError` with the given `error`.
|
/// 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 {
|
RuntimeError {
|
||||||
inner: Arc::new(RuntimeErrorSource::User(Box::new(error))),
|
inner: Arc::new(RuntimeErrorSource::User(Box::new(error))),
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ impl From<JsValue> for RuntimeError {
|
|||||||
// We try to downcast the error and see if it's
|
// We try to downcast the error and see if it's
|
||||||
// an instance of RuntimeError instead, so we don't need
|
// an instance of RuntimeError instead, so we don't need
|
||||||
// to re-wrap it.
|
// 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)),
|
inner: Arc::new(RuntimeErrorSource::Js(js)),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user