webidl: add support for static methods

This commit is contained in:
R. Andrew Ohana
2018-06-14 19:21:33 -07:00
parent 639ccd53ce
commit fe5cde8636
5 changed files with 186 additions and 88 deletions

View File

@ -552,11 +552,12 @@ impl ToTokens for ast::ImportFunction {
let mut class_ty = None;
let mut is_method = false;
match self.kind {
ast::ImportFunctionKind::Method { ref ty, .. } => {
is_method = true;
class_ty = Some(ty);
}
ast::ImportFunctionKind::JsConstructor { ref ty, .. } => {
ast::ImportFunctionKind::Method {
ref ty, ref kind, ..
} => {
if let ast::MethodKind::Normal = kind {
is_method = true;
}
class_ty = Some(ty);
}
ast::ImportFunctionKind::Normal => {}