Skip to content

Commit c4c0fea

Browse files
committed
Fix a __wbindgen_placeholder__ module leaking through
With #1267 now fixed looks like we had an accidental regression sneak through in the meantime!
1 parent cb432be commit c4c0fea

File tree

1 file changed

+9
-8
lines changed
  • crates/cli-support/src/js

1 file changed

+9
-8
lines changed

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

+9-8
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,15 @@ impl<'a> Context<'a> {
615615
if self.config.emit_start {
616616
self.add_start_function()?;
617617
has_start_function = self.unstart_start_function();
618+
619+
// In the "we're pretending to be an ES module use case if we've got
620+
// a start function then we use an injected shim to actually execute
621+
// the real start function on the next tick of the microtask queue
622+
// (explained above)
623+
if !self.config.no_modules && has_start_function {
624+
self.inject_start_shim();
625+
}
626+
618627
}
619628

620629
self.export_table()?;
@@ -786,14 +795,6 @@ impl<'a> Context<'a> {
786795
},
787796
)
788797
} else {
789-
// In the "we're pretending to be an ES module use case if we've got
790-
// a start function then we use an injected shim to actually execute
791-
// the real start function on the next tick of the microtask queue
792-
// (explained above)
793-
if has_start_function {
794-
self.inject_start_shim();
795-
}
796-
797798
let import_wasm = if self.globals.len() == 0 {
798799
String::new()
799800
} else if self.use_node_require() {

0 commit comments

Comments
 (0)