Open
Description
Many JavaScript libraries are async and I have not seen that WebAssembly supports promises yet.
In order to easily write performant applications that leverage the JS ecosystem I'd suggest to add support of promises in imported functions.
For instance this should work:
const importObject = {
returnOneAsync: () => new Promise(done => done(1))
};
extern "C" int returnOneAsync();
int main(){
int x = returnOneAsync(); // should suspend main until promise resolved.
return x+x;
}