mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-18 23:41:24 +00:00
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:
@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user