I am attempting to run WebAssembly on the new V8 Google Apps Script runtime, and it appears to be supported, however it seems that async functions are terminated after they return a Promise.
let wasm= new Uint8Array([/* snip */]).buffer
function add(a,b) {
return((async()=>{
console.log("running function...")
results=await WebAssembly.instantiate(wasm)
return results.instance.exports.add(a,b)
})());
}
function test(){
add(2,3).then(console.log).catch(console.error)
}
when I run test
"running function..." is logged, then nothing. No errors, no results. I have confirmed that WebAssembly.instantiate
returns a Promise.
Does anyone know what is going on, or is this something to ask Google about?
Update:
Created a issue at https://issuetracker.google.com/issues/153828715
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…