Files
haskell-wasm/tests/runnable/index.html
T
2018-02-25 11:28:51 -08:00

14 lines
436 B
HTML

<script>
fetch('fact.wast').then(response =>
response.arrayBuffer()
).then(bytes =>
WebAssembly.instantiate(bytes, {})
).then(results => {
console.log('result', results)
const fact = results.instance.exports['fac-iter-named-32']
const factRec = results.instance.exports['fac-rec-named-32']
console.log(fact, fact(5))
console.log(factRec, factRec(5))
});
</script>