From b4f172899c6541cd9e3644afaccdd23429739e53 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 3 Jan 2019 11:38:01 -0800 Subject: [PATCH] Fix order of export/gc We might gc a table away so if we need to export it be sure to do so before we gc! Additionally remove an extraneous gc that snuck in at some point, no need to do more than one. Closes #1130 --- crates/cli-support/src/js/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index cf661e8f4af..b068cbca8fc 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -457,6 +457,7 @@ impl<'a> Context<'a> { } } + self.export_table(); self.gc(); // Note that it's important `throw` comes last *after* we gc. The @@ -628,9 +629,6 @@ impl<'a> Context<'a> { ) }; - self.export_table(); - self.gc(); - while js.contains("\n\n\n") { js = js.replace("\n\n\n", "\n\n"); }