mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-10 14:48:27 +00:00
cargo fmt && fix issue with function_body_ptr
This commit is contained in:
6
lib/api/src/js/externals/function.rs
vendored
6
lib/api/src/js/externals/function.rs
vendored
@@ -908,7 +908,7 @@ mod inner {
|
||||
Kind: HostFunctionKind,
|
||||
{
|
||||
/// Get the pointer to the function body.
|
||||
fn function_body_ptr(self) -> *const VMFunctionBody;
|
||||
fn function_body_ptr(&self) -> *const VMFunctionBody;
|
||||
|
||||
// /// Get the pointer to the function call trampoline.
|
||||
// fn call_trampoline_address() -> VMTrampoline;
|
||||
@@ -1122,7 +1122,7 @@ mod inner {
|
||||
Func: Fn(FunctionEnvMut<'_, T>, $( $x , )*) -> RetsAsResult + 'static,
|
||||
{
|
||||
#[allow(non_snake_case)]
|
||||
fn function_body_ptr(self) -> *const VMFunctionBody {
|
||||
fn function_body_ptr(&self) -> *const VMFunctionBody {
|
||||
/// This is a function that wraps the real host
|
||||
/// function. Its address will be used inside the
|
||||
/// runtime.
|
||||
@@ -1170,7 +1170,7 @@ mod inner {
|
||||
Func: Fn($( $x , )*) -> RetsAsResult + 'static,
|
||||
{
|
||||
#[allow(non_snake_case)]
|
||||
fn function_body_ptr(self) -> *const VMFunctionBody {
|
||||
fn function_body_ptr(&self) -> *const VMFunctionBody {
|
||||
/// This is a function that wraps the real host
|
||||
/// function. Its address will be used inside the
|
||||
/// runtime.
|
||||
|
||||
@@ -118,10 +118,8 @@ impl Instance {
|
||||
.map(|export_type| {
|
||||
let name = export_type.name();
|
||||
let extern_type = export_type.ty().clone();
|
||||
let js_export =
|
||||
js_sys::Reflect::get(&instance_exports, &name.into()).map_err(|_e| {
|
||||
InstantiationError::NotInExports(name.to_string())
|
||||
})?;
|
||||
let js_export = js_sys::Reflect::get(&instance_exports, &name.into())
|
||||
.map_err(|_e| InstantiationError::NotInExports(name.to_string()))?;
|
||||
let export: Export =
|
||||
Export::from_js_value(js_export, &mut store, extern_type)?.into();
|
||||
let extern_ = Extern::from_vm_extern(&mut store, export);
|
||||
|
||||
@@ -560,11 +560,11 @@ impl Module {
|
||||
/// is returned.
|
||||
pub fn custom_sections<'a>(&'a self, name: &'a str) -> impl Iterator<Item = Box<[u8]>> + 'a {
|
||||
// TODO: implement on JavaScript
|
||||
DefaultCustomSectionsIterator { }
|
||||
DefaultCustomSectionsIterator {}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DefaultCustomSectionsIterator { }
|
||||
pub struct DefaultCustomSectionsIterator {}
|
||||
|
||||
impl Iterator for DefaultCustomSectionsIterator {
|
||||
type Item = Box<[u8]>;
|
||||
|
||||
6
lib/api/src/sys/externals/function.rs
vendored
6
lib/api/src/sys/externals/function.rs
vendored
@@ -1092,7 +1092,7 @@ mod inner {
|
||||
Kind: HostFunctionKind,
|
||||
{
|
||||
/// Get the pointer to the function body.
|
||||
fn function_body_ptr(self) -> *const VMFunctionBody;
|
||||
fn function_body_ptr(&self) -> *const VMFunctionBody;
|
||||
|
||||
/// Get the pointer to the function call trampoline.
|
||||
fn call_trampoline_address() -> VMTrampoline;
|
||||
@@ -1268,7 +1268,7 @@ mod inner {
|
||||
Func: Fn(FunctionEnvMut<T>, $( $x , )*) -> RetsAsResult + 'static,
|
||||
{
|
||||
#[allow(non_snake_case)]
|
||||
fn function_body_ptr(self) -> *const VMFunctionBody {
|
||||
fn function_body_ptr(&self) -> *const VMFunctionBody {
|
||||
/// This is a function that wraps the real host
|
||||
/// function. Its address will be used inside the
|
||||
/// runtime.
|
||||
@@ -1352,7 +1352,7 @@ mod inner {
|
||||
Func: Fn($( $x , )*) -> RetsAsResult + 'static,
|
||||
{
|
||||
#[allow(non_snake_case)]
|
||||
fn function_body_ptr(self) -> *const VMFunctionBody {
|
||||
fn function_body_ptr(&self) -> *const VMFunctionBody {
|
||||
/// This is a function that wraps the real host
|
||||
/// function. Its address will be used inside the
|
||||
/// runtime.
|
||||
|
||||
Reference in New Issue
Block a user