From c4c0fea05e73e847dd3e5bd8a2157c505a8d5d14 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 28 Feb 2019 07:32:30 -0800 Subject: [PATCH] Fix a `__wbindgen_placeholder__` module leaking through With #1267 now fixed looks like we had an accidental regression sneak through in the meantime! --- crates/cli-support/src/js/mod.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 68d11086..34d61b25 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -615,6 +615,15 @@ impl<'a> Context<'a> { if self.config.emit_start { self.add_start_function()?; has_start_function = self.unstart_start_function(); + + // In the "we're pretending to be an ES module use case if we've got + // a start function then we use an injected shim to actually execute + // the real start function on the next tick of the microtask queue + // (explained above) + if !self.config.no_modules && has_start_function { + self.inject_start_shim(); + } + } self.export_table()?; @@ -786,14 +795,6 @@ impl<'a> Context<'a> { }, ) } else { - // In the "we're pretending to be an ES module use case if we've got - // a start function then we use an injected shim to actually execute - // the real start function on the next tick of the microtask queue - // (explained above) - if has_start_function { - self.inject_start_shim(); - } - let import_wasm = if self.globals.len() == 0 { String::new() } else if self.use_node_require() {