mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 18:20:51 +00:00
Merge pull request #1025 from alexcrichton/fix-create
Fix `--no-modules` passing in `WebAssembly.Module`
This commit is contained in:
commit
d37052f8b4
@ -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…
x
Reference in New Issue
Block a user