Use the JS name of an imported type for instanceof checks

This commit is contained in:
Nick Fitzgerald
2018-08-07 16:18:13 -07:00
parent 9104bf87e9
commit 998d37a353
6 changed files with 31 additions and 2 deletions

View File

@ -125,6 +125,7 @@ pub struct ImportStatic {
pub struct ImportType {
pub vis: syn::Visibility,
pub rust_name: Ident,
pub js_name: String,
pub attrs: Vec<syn::Attribute>,
pub doc_comment: Option<String>,
pub instanceof_shim: String,
@ -411,7 +412,7 @@ impl ImportStatic {
impl ImportType {
fn shared(&self) -> shared::ImportType {
shared::ImportType {
name: self.rust_name.to_string(),
name: self.js_name.clone(),
instanceof_shim: self.instanceof_shim.clone(),
}
}