mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-01 18:01:06 +00:00
Improve leniency of --no-modules
output
Instead of assuming names like `URL` and `Request` are defined, instead check to see if they exist first and otherwise skip the checks that reference them.
This commit is contained in:
parent
68a1519eaa
commit
423bebbd14
@ -502,7 +502,7 @@ impl<'a> Context<'a> {
|
|||||||
let result;
|
let result;
|
||||||
const imports = {{}};
|
const imports = {{}};
|
||||||
{imports_init}
|
{imports_init}
|
||||||
if (module instanceof URL || typeof module === 'string' || module instanceof Request) {{
|
if ((typeof URL === 'function' && module instanceof URL) || typeof module === 'string' || (typeof Request === 'function' && module instanceof Request)) {{
|
||||||
{init_memory2}
|
{init_memory2}
|
||||||
const response = fetch(module);
|
const response = fetch(module);
|
||||||
if (typeof WebAssembly.instantiateStreaming === 'function') {{
|
if (typeof WebAssembly.instantiateStreaming === 'function') {{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user