mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-24 06:33:33 +03:00
Fix --no-modules
passing in WebAssembly.Module
This fixes a mistake in allowing a `WebAssembly.Module` to be passed to the initialization function in `--no-modules` mode by ensuring that it resolves to a map of an instance/module instead of just resolving to an instance.
This commit is contained in:
parent
4c4f8f16bd
commit
37889d9fcd
@ -509,7 +509,10 @@ impl<'a> Context<'a> {
|
||||
let instantiation;
|
||||
const imports = {{ './{module}': __exports }};
|
||||
if (path_or_module instanceof WebAssembly.Module) {{
|
||||
instantiation = WebAssembly.instantiate(path_or_module, imports);
|
||||
instantiation = WebAssembly.instantiate(path_or_module, imports)
|
||||
.then(instance => {{
|
||||
return {{ instance, module: module_or_path }}
|
||||
}});
|
||||
}} else {{
|
||||
const data = fetch(path_or_module);
|
||||
if (typeof WebAssembly.instantiateStreaming === 'function') {{
|
||||
|
Loading…
Reference in New Issue
Block a user