mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 05:52:21 +03:00
parent
7af4e62d99
commit
4148d3b4ac
@ -166,7 +166,7 @@ impl BindgenAttrs {
|
||||
}).next()
|
||||
}
|
||||
|
||||
/// Get the first js_name attribute
|
||||
/// Get the first js_class attribute
|
||||
fn js_class(&self) -> Option<&str> {
|
||||
self.attrs
|
||||
.iter()
|
||||
@ -495,6 +495,10 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a Option<String>)> for syn::ForeignItemFn
|
||||
_ => bail_span!(self, "return value of constructor must be a bare path"),
|
||||
};
|
||||
let class_name = extract_path_ident(class_name)?;
|
||||
let class_name = opts
|
||||
.js_class()
|
||||
.map(Into::into)
|
||||
.unwrap_or_else(|| class_name.to_string());
|
||||
|
||||
ast::ImportFunctionKind::Method {
|
||||
class: class_name.to_string(),
|
||||
|
Loading…
Reference in New Issue
Block a user