diff --git a/lib/api/src/js/externals/function.rs b/lib/api/src/js/externals/function.rs index 4cece882026..f5ee117cef9 100644 --- a/lib/api/src/js/externals/function.rs +++ b/lib/api/src/js/externals/function.rs @@ -445,11 +445,10 @@ impl Function { Args: WasmTypeList, Rets: WasmTypeList, { - let vm_function = self.handle.get(store.as_store_ref().objects()); - + let ty = self.ty(store); // type check { - let expected = vm_function.ty.params(); + let expected = ty.params(); let given = Args::wasm_types(); if expected != given { @@ -462,7 +461,7 @@ impl Function { } { - let expected = vm_function.ty.results(); + let expected = ty.results(); let given = Rets::wasm_types(); if expected != given { diff --git a/lib/api/src/lib.rs b/lib/api/src/lib.rs index 98b29b2fff1..6a4686033ff 100644 --- a/lib/api/src/lib.rs +++ b/lib/api/src/lib.rs @@ -54,7 +54,6 @@ //! "#; //! //! let mut store = Store::default(); -//! let env = FunctionEnv::new(&mut store, ()); //! let module = Module::new(&store, &module_wat)?; //! // The module doesn't import anything, so we create an empty import object. //! let import_object = imports! {}; diff --git a/lib/api/src/sys/externals/function.rs b/lib/api/src/sys/externals/function.rs index aa6dcc9f9f8..c317b9648ca 100644 --- a/lib/api/src/sys/externals/function.rs +++ b/lib/api/src/sys/externals/function.rs @@ -530,11 +530,11 @@ impl Function { Args: WasmTypeList, Rets: WasmTypeList, { - let vm_function = self.handle.get(store.as_store_ref().objects()); + let ty = self.ty(store); // type check { - let expected = vm_function.signature.params(); + let expected = ty.params(); let given = Args::wasm_types(); if expected != given { @@ -547,7 +547,7 @@ impl Function { } { - let expected = vm_function.signature.results(); + let expected = ty.results(); let given = Rets::wasm_types(); if expected != given {