Added proof of concept of function bindings

This commit is contained in:
Syrus Akbary
2021-06-22 19:01:32 -07:00
parent b326903a35
commit 6a40185680

View File

@@ -298,9 +298,10 @@ impl Function {
let ft = wasm_bindgen::function_table();
let as_table = ft.unchecked_ref::<js_sys::WebAssembly::Table>();
let func = as_table.get(address).unwrap();
let binded_func = func.bind1(&JsValue::UNDEFINED, &JsValue::UNDEFINED);
Self {
store: store.clone(),
exported: func,
exported: binded_func,
}
// let vmctx = VMFunctionEnvironment {
@@ -1318,7 +1319,7 @@ mod inner {
/// This is a function that wraps the real host
/// function. Its address will be used inside the
/// runtime.
extern fn func_wrapper<$( $x, )* Rets, RetsAsResult, Func>( $( $x: $x::Native, )* ) -> Rets::CStruct
extern fn func_wrapper<$( $x, )* Rets, RetsAsResult, Func>( _: usize, $( $x: $x::Native, )* ) -> Rets::CStruct
where
$( $x: FromToNativeWasmType, )*
Rets: WasmTypeList,