Verified
Status Update
Comments
du...@google.com <du...@google.com>
du...@google.com <du...@google.com> #2
Hi,
Thanks for your input, I've reported this case internally so it can be reviewed.
is...@google.com <is...@google.com>
ge...@gmail.com <ge...@gmail.com> #3
My experiments with WebAssembly hit this bug too. Looking forward to it being fixed!
ga...@google.com <ga...@google.com>
[Deleted User] <[Deleted User]> #4
+ 1 for the fix
ti...@gmail.com <ti...@gmail.com> #5
+1
x7...@gmail.com <x7...@gmail.com> #6
+1
di...@gmail.com <di...@gmail.com> #7
Seems to work now. Had to refactor your sample code a bit:
async function testWasm() {
let bytes = new Uint8Array([0,97,115,109,1,0,0,0,1,7,1,96,2,127,127,1,127,3,2,1,0,7,7,1,3,97,100,100,0,0,10,9,1,7,0,32,0,32,1,106,11,0,28,4,110,97,109,101,1,6,1,0,3,97,100,100,2,13,1,0,2,0,3,108,104,115,1,3,114,104,115]);
let {
instance: {
exports: {
add
}
}
} = await WebAssembly.instantiate(bytes);
console.log(add(2,3));
}
Description
Code to reproduce:
```js
console.log(WebAssembly.instantiate(new Uint8Array([0,97,115,109,1,0,0,0,1,7,1,96,2,127,127,1,127,3,2,1,0,7,7,1,3,97,100,100,0,0,10,9,1,7,0,32,0,32,1,106,11,0,28,4,110,97,109,101,1,6,1,0,3,97,100,100,2,13,1,0,2,0,3,108,104,115,1,3,114,104,115]).buffer).then(r=>console.log(r.instance.exports.add(2,3))).toString())
```
What steps will reproduce the problem?
1. Open a script
2. Put the above code in a function
3. Run the function
4. Check the logs
Expected output:
```
[object Promise]
5
```
Actual output:
```
[object Promise]
```