feat(ast): complete AccessorProperty todo in has_decorator (#2178)

This commit is contained in:
Dunqing 2024-01-26 15:47:26 +08:00 committed by GitHub
parent cba8a4c131
commit 080e78c647
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1911,18 +1911,14 @@ impl<'a> ClassElement<'a> {
}
pub fn has_decorator(&self) -> bool {
#[allow(clippy::match_same_arms)]
match self {
Self::TSIndexSignature(_)
| Self::TSAbstractMethodDefinition(_)
| Self::TSAbstractPropertyDefinition(_) => false,
Self::MethodDefinition(method) => !method.decorators.is_empty(),
Self::PropertyDefinition(property) => !property.decorators.is_empty(),
Self::AccessorProperty(_) => {
// TODO: AccessorProperty doesn't have decorators property
false
}
Self::StaticBlock(_) => false,
Self::AccessorProperty(property) => !property.decorators.is_empty(),
Self::StaticBlock(_)
| Self::TSIndexSignature(_)
| Self::TSAbstractMethodDefinition(_)
| Self::TSAbstractPropertyDefinition(_) => false,
}
}
}