Skip to content

Commit

Permalink
Fixed error
Browse files Browse the repository at this point in the history
  • Loading branch information
vikram-kangotra committed Aug 16, 2023
1 parent 231cb31 commit b87fb1f
Showing 1 changed file with 29 additions and 15 deletions.
44 changes: 29 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
fetch('./wasm_web_test.wasm')
.then(response => response.arrayBuffer())
.then(bytes => WebAssembly.instantiate(bytes, {}))
.then(results => {
console.log(results.instance.exports.double(10));
});
</script>
</body>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var wasmImports = {
invoke_vii: function(index, arg) {},
invoke_ii: function(index, arg) {},
invoke_v: function(index, arg) {},
__cxa_begin_catch: function() {},
proc_exit: function() {},
__cxa_find_matching_catch_3: function() {},
};

var info = {
'env': wasmImports,
'wasi_snapshot_preview1': wasmImports,
};

fetch('./wasm_web_test.wasm')
.then(response => response.arrayBuffer())
.then(bytes => WebAssembly.instantiate(bytes, info))
.then(results => {
console.log(results.instance.exports.double(10));
});
</script>
</body>
</html>

0 comments on commit b87fb1f

Please sign in to comment.