You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Asyncify JS library funcs under any namespace (#20223)
Previously any JS library funcs were passed to ASYNCIFY_IMPORTS under `env.` prefix.
This can be problematic when implementing WASI functions using Asyncify, since we pass the same `wasmImports` object under both `env` and `wasi_snapshot_preview1` namespaces, and don't really differentiate under which namespace it will be called in the JS code.
One existing example of this was `fd_sync` which already had to be hardcoded in `DEFAULT_ASYNCIFY_IMPORTS`, but there can be more examples both in the future as well as today in user's code that wants to override WASI functions with some Asyncify code.
The simplest and most reliable fix to cover those scenarios is to do what JS already does and not differentiate between namespaces - that is, pass `*.{name}` instead of `env.{name}` so that function is correctly Asyncified no matter under which namespace it ends up imported in the Wasm module.
0 commit comments