web-sys: Don't remove dictionaries if required fields are removed

This commit updates the conditional binding generation for dictionaries
to ensure that a dictionary is not entirely removed if any of its
required fields are removed. If a required field is removed, however, it
cannot be constructed, so the constructor is removed.
This commit is contained in:
Alex Crichton
2019-06-03 12:56:18 -07:00
parent 618b5d3531
commit 877c31cdc8
4 changed files with 22 additions and 17 deletions

View File

@ -317,6 +317,7 @@ impl<'src> FirstPassRecord<'src> {
program.dictionaries.push(ast::Dictionary {
name: rust_ident(&camel_case_ident(def.identifier.0)),
fields,
ctor: true,
});
}
@ -784,6 +785,7 @@ impl<'src> FirstPassRecord<'src> {
program.dictionaries.push(ast::Dictionary {
name: rust_ident(&camel_case_ident(item.definition.identifier.0)),
fields,
ctor: true,
});
}
}