Skip to content

Commit 423bebb

Browse files
committed
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.
1 parent 68a1519 commit 423bebb

File tree

1 file changed

+1
-1
lines changed
  • crates/cli-support/src/js

1 file changed

+1
-1
lines changed

crates/cli-support/src/js/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ impl<'a> Context<'a> {
502502
let result;
503503
const imports = {{}};
504504
{imports_init}
505-
if (module instanceof URL || typeof module === 'string' || module instanceof Request) {{
505+
if ((typeof URL === 'function' && module instanceof URL) || typeof module === 'string' || (typeof Request === 'function' && module instanceof Request)) {{
506506
{init_memory2}
507507
const response = fetch(module);
508508
if (typeof WebAssembly.instantiateStreaming === 'function') {{

0 commit comments

Comments
 (0)