File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ import { Type } from "../src/types";
1313
1414wasm . setPanicHook ( ) ;
1515
16- // @ts -expect-error
17- const WASM_MEMORY : WebAssembly . Memory = wasm . __wasm . memory ;
16+ const WASM_MEMORY = wasm . wasmMemory ( ) ;
1817
1918const TEST_TABLE = loadIPCTableFromDisk ( "tests/table.arrow" ) ;
2019const FFI_TABLE = arrowTableToFFI ( TEST_TABLE ) ;
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ import { readFileSync } from "fs";
1010
1111wasm . setPanicHook ( ) ;
1212
13- // @ts -expect-error
14- const WASM_MEMORY : WebAssembly . Memory = wasm . __wasm . memory ;
13+ const WASM_MEMORY = wasm . wasmMemory ( )
1514
1615const TEST_TABLE = loadIPCTableFromDisk ( "tests/table.arrow" ) ;
1716const FFI_RECORD_BATCH = arrowTableToFFIRecordBatch ( TEST_TABLE ) ;
Original file line number Diff line number Diff line change @@ -57,3 +57,16 @@ pub fn set_panic_hook() {
5757 // https://github.com/rustwasm/console_error_panic_hook#readme
5858 console_error_panic_hook:: set_once ( ) ;
5959}
60+
61+ /// Returns a handle to this wasm instance's `WebAssembly.Memory`
62+ #[ wasm_bindgen( js_name = wasmMemory) ]
63+ pub fn memory ( ) -> JsValue {
64+ wasm_bindgen:: memory ( )
65+ }
66+
67+ /// Returns a handle to this wasm instance's `WebAssembly.Table` which is the indirect function
68+ /// table used by Rust
69+ #[ wasm_bindgen( js_name = _functionTable) ]
70+ pub fn function_table ( ) -> JsValue {
71+ wasm_bindgen:: function_table ( )
72+ }
You can’t perform that action at this time.
0 commit comments