Fix #[wasm_bindgen] on structs with no exports

It should still be usable in other types!

Closes #27
This commit is contained in:
Alex Crichton
2018-02-16 13:49:53 -08:00
parent c148a3b6dc
commit 7802535948
3 changed files with 60 additions and 11 deletions

View File

@ -289,6 +289,7 @@ impl Program {
("custom_type_names", &|a| {
let names = self.exports.iter()
.filter_map(|e| e.class)
.chain(self.structs.iter().map(|s| s.name))
.collect::<BTreeSet<_>>();
a.list(&names, |s, a| {
let val = shared::name_to_descriptor(s.as_ref());