diff options
author | Search <60404136+searchableguy@users.noreply.github.com> | 2020-09-27 01:18:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-27 05:48:32 +1000 |
commit | 52c67d301c6043e3b5db874ddc3b1d0d2abd1a04 (patch) | |
tree | d9dd6727a081243b27da3b4ed1146230db478811 /docs/getting_started/webassembly.md | |
parent | c03fe284cf12486eed9b70b6fa1e30bc03ccf9c8 (diff) |
docs(cli): Update web assembly example and accepted compiler options in docs. (#7678)
Fixes #7556
Fixes #7634
Diffstat (limited to 'docs/getting_started/webassembly.md')
-rw-r--r-- | docs/getting_started/webassembly.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/getting_started/webassembly.md b/docs/getting_started/webassembly.md index 613be2fcd..b7ca6ee40 100644 --- a/docs/getting_started/webassembly.md +++ b/docs/getting_started/webassembly.md @@ -4,7 +4,7 @@ Deno can execute [WebAssembly](https://webassembly.org/) binaries. <!-- dprint-ignore --> -```js +```ts const wasmCode = new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 133, 128, 128, 128, 0, 1, 96, 0, 1, 127, 3, 130, 128, 128, 128, 0, 1, 0, 4, 132, 128, 128, 128, 0, 1, 112, 0, 0, @@ -15,5 +15,6 @@ const wasmCode = new Uint8Array([ ]); const wasmModule = new WebAssembly.Module(wasmCode); const wasmInstance = new WebAssembly.Instance(wasmModule); +const main = wasmInstance.exports.main as CallableFunction console.log(wasmInstance.exports.main().toString()); ``` |