-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
28 lines (23 loc) · 679 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// import { run } from './pkg';
// const res = await run('wit-bindgen');
// console.log(res)
// import init, { run } from './pkg';
// await init();
// const res = await run('wit-bindgen');
// console.log(res)
// const guestImports = {
// blockless: {
// run,
// },
// };
// const { instance, module } = await WebAssembly.instantiateStreaming(
// fetch("./exam1.wasm"),
// guestImports,
// );
// console.log(instance.exports.run("wit-bindgen"));
const importObject = {
blockless: { run: (arg) => console.log(arg) },
};
WebAssembly.instantiateStreaming(fetch("./simple.wasm"), importObject).then(
(obj) => obj.instance.exports.exported_func(),
);