mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 14:27:36 +03:00
parent
7af4e62d99
commit
4148d3b4ac
@ -166,7 +166,7 @@ impl BindgenAttrs {
|
|||||||
}).next()
|
}).next()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the first js_name attribute
|
/// Get the first js_class attribute
|
||||||
fn js_class(&self) -> Option<&str> {
|
fn js_class(&self) -> Option<&str> {
|
||||||
self.attrs
|
self.attrs
|
||||||
.iter()
|
.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"),
|
_ => bail_span!(self, "return value of constructor must be a bare path"),
|
||||||
};
|
};
|
||||||
let class_name = extract_path_ident(class_name)?;
|
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 {
|
ast::ImportFunctionKind::Method {
|
||||||
class: class_name.to_string(),
|
class: class_name.to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user