Propagate missing memory argument (#2011)

Fixes #2010.
This commit is contained in:
Ingvar Stepanyan 2020-02-20 17:33:40 +00:00 committed by GitHub
parent ec1b9453c9
commit d26068dc6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -510,7 +510,7 @@ impl<'a> Context<'a> {
let js = format!( let js = format!(
"\ "\
async function load(module, imports) {{ async function load(module, imports{init_memory_arg}) {{
if (typeof Response === 'function' && module instanceof Response) {{ if (typeof Response === 'function' && module instanceof Response) {{
{init_memory2} {init_memory2}
if (typeof WebAssembly.instantiateStreaming === 'function') {{ if (typeof WebAssembly.instantiateStreaming === 'function') {{
@ -556,7 +556,7 @@ impl<'a> Context<'a> {
input = fetch(input); input = fetch(input);
}} }}
const {{ instance, module }} = await load(await input, imports); const {{ instance, module }} = await load(await input, imports{init_memory_arg});
wasm = instance.exports; wasm = instance.exports;
init.__wbindgen_wasm_module = module; init.__wbindgen_wasm_module = module;