You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Replace the recommended WASI implementation with `@bjorn3/browser_wasi_shim`
for better quality and maintainability.
* Remove error-prone top-level code and `main` function from the example by recommending
`-parse-as-library` option.
* Use ESM syntax for the JavaScript example since
`@bjorn3/browser_wasi_shim` works with ESM only.
// Initialize the instance by following WASI reactor ABI
55
+
wasi.initialize(instance);
56
+
// Get the exported function
57
+
constaddFn=instance.exports.add;
58
+
console.log("2 + 3 = "+addFn(2, 3))
70
59
```
71
60
72
61
If you use SwiftPM package, you can omit linker flag using clang's `__atribute__`. Please see [swiftwasm/JavaScriptKit#91](https://github.com/swiftwasm/JavaScriptKit/pull/91/files) for more detail info
0 commit comments