File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,6 @@ export const __asbind_I32ArrayArray_ID = idof<Array<Array<i32>>>();
32
32
export const __asbind_I64ArrayArray_ID = idof < Array < Array < i64 > > > ( ) ;
33
33
export const __asbind_StringArrayArray_ID = idof < Array < Array < string > > > ( ) ;
34
34
export const __asbind_BoolArrayArray_ID = idof < Array < Array < bool > > > ( ) ;
35
+
36
+ // As-Bind type data
37
+ export const __asbind_type_data : string = "" ;
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ const fs = require("fs/promises");
2
2
3
3
async function main ( ) {
4
4
const b = await fs . readFile ( process . argv [ 2 ] ) ;
5
- const { instance } = await WebAssembly . instantiate ( b ) ;
5
+ const { instance } = await WebAssembly . instantiate ( b , {
6
+ env : { abort ( ) { } }
7
+ } ) ;
6
8
const ptr = instance . exports . __asbind_type_data . value ;
7
9
const dv = new DataView ( instance . exports . memory . buffer ) ;
8
10
const strLen = dv . getUint32 ( ptr - 4 , true ) ;
@@ -13,5 +15,7 @@ async function main() {
13
15
) ;
14
16
const str = new TextDecoder ( "utf-16le" ) . decode ( strView ) ;
15
17
console . log ( { str } ) ;
18
+ const data = JSON . parse ( str ) ;
19
+ console . log ( JSON . stringify ( data , null , 2 ) ) ;
16
20
}
17
21
main ( ) ;
You can’t perform that action at this time.
0 commit comments