mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-13 05:48:45 +00:00
Fixed lint and errors
This commit is contained in:
2
lib/js-api/src/externals/function.rs
vendored
2
lib/js-api/src/externals/function.rs
vendored
@@ -2,10 +2,10 @@ use crate::exports::{ExportError, Exportable};
|
||||
use crate::externals::Extern;
|
||||
use crate::store::Store;
|
||||
use crate::types::{param_from_js, AsJs /* ValFuncRef */, Val};
|
||||
use crate::FunctionType;
|
||||
use crate::NativeFunc;
|
||||
use crate::RuntimeError;
|
||||
use crate::WasmerEnv;
|
||||
use crate::{FunctionType, ValType};
|
||||
pub use inner::{FromToNativeWasmType, HostFunction, WasmTypeList, WithEnv, WithoutEnv};
|
||||
use js_sys::{Array, Function as JSFunction};
|
||||
use std::iter::FromIterator;
|
||||
|
||||
@@ -128,7 +128,7 @@ impl Instance {
|
||||
|
||||
let self_instance = Self {
|
||||
module: module.clone(),
|
||||
instance: instance,
|
||||
instance,
|
||||
exports,
|
||||
};
|
||||
for func in functions {
|
||||
|
||||
@@ -12,7 +12,7 @@ use std::marker::PhantomData;
|
||||
use crate::{FromToNativeWasmType, Function, RuntimeError, Store, WasmTypeList};
|
||||
// use std::panic::{catch_unwind, AssertUnwindSafe};
|
||||
use crate::export::VMFunction;
|
||||
use crate::types::{param_from_js, AsJs};
|
||||
use crate::types::param_from_js;
|
||||
use js_sys::Array;
|
||||
use std::iter::FromIterator;
|
||||
use wasm_bindgen::JsValue;
|
||||
@@ -90,13 +90,12 @@ macro_rules! impl_native_traits {
|
||||
let val = param_from_js(&ty, &results);
|
||||
val.write_value_to(mut_rets);
|
||||
}
|
||||
n => {
|
||||
_n => {
|
||||
let results: Array = results.into();
|
||||
for (i, ret_type) in Rets::wasm_types().iter().enumerate() {
|
||||
let ret = results.get(i as u32);
|
||||
unsafe {
|
||||
let val = param_from_js(&ret_type, &ret);
|
||||
let p = mut_rets.add(i);
|
||||
val.write_value_to(mut_rets.add(i));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user