More aggressively gc module

As soon as we've removed unneeded exports immediately run a gc pass to ensure
that we don't bind functions in JS that don't actually end up getting needed.
This commit is contained in:
Alex Crichton
2018-04-05 18:30:37 -07:00
parent f7f0d578e7
commit 66bdd92fa2
2 changed files with 19 additions and 6 deletions

View File

@ -129,10 +129,7 @@ impl Bindgen {
let wasm_bytes = parity_wasm::serialize(module).map_err(|e| {
Error(format!("{:?}", e))
})?;
let bytes = wasm_gc::Config::new()
.demangle(false)
.gc(&wasm_bytes)?;
File::create(&wasm_path)?.write_all(&bytes)?;
File::create(&wasm_path)?.write_all(&wasm_bytes)?;
Ok(())
}