Be sure to GC our imports as well as the module

After a module goes through its primary GC pass we need to look over the
set of remaining imports and use that to prune the set of imports that
we're binding.

Closes #1613
This commit is contained in:
Alex Crichton
2019-06-23 08:16:11 -07:00
parent a1fc270f2a
commit 2e03961ca1
2 changed files with 26 additions and 1 deletions

View File

@ -136,3 +136,18 @@ fn works_on_empty_project() {
}
mod npm;
#[test]
fn one_export_works() {
let (mut cmd, _out_dir) = Project::new("one_export_works")
.file(
"src/lib.rs",
r#"
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn foo() {}
"#,
)
.wasm_bindgen("");
cmd.assert().success();
}