From 1c52fb1b2fd69215a9fd1c27c4108b23de8661eb Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 13 Sep 2018 22:10:59 -0700 Subject: [PATCH] Remove leading and trailing blanks from the --no-modules output The output using modules already uses string formatting that carefully avoids emitting leading and trailing blanks; adjust the --no-modules output to match. --- crates/cli-support/src/js/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 29c3be868..e1a9175db 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -417,7 +417,7 @@ impl<'a> Context<'a> { let mut js = if self.config.no_modules { format!( - " + "\ (function() {{ var wasm; const __exports = {{}}; @@ -438,8 +438,7 @@ impl<'a> Context<'a> { }}); }}; self.{global_name} = Object.assign(init, __exports); - }})(); - ", + }})();", globals = self.globals, module = module_name, global_name = self.config.no_modules_global