@@ -603,7 +603,9 @@ impl<'a> LegacyDecorator<'a, '_> {
603603
604604 for element in & mut class. body . body {
605605 let ( is_static, key, descriptor, decorations) = match element {
606- ClassElement :: MethodDefinition ( method) if !method. value . is_typescript_syntax ( ) => {
606+ ClassElement :: MethodDefinition ( method)
607+ if !method. value . is_typescript_syntax ( ) && method. value . body . is_some ( ) =>
608+ {
607609 let Some ( decorations) = self . get_all_decorators_of_class_method ( method, ctx)
608610 else {
609611 continue ;
@@ -876,7 +878,10 @@ impl<'a> LegacyDecorator<'a, '_> {
876878 PrivateInExpressionDetector :: has_private_in_expression_in_method_decorator ( method) ;
877879 }
878880 }
879- ClassElement :: MethodDefinition ( method) if !method. value . is_typescript_syntax ( ) => {
881+ ClassElement :: MethodDefinition ( method)
882+ if !method. value . r#type . is_typescript_syntax ( )
883+ && method. value . body . is_some ( ) =>
884+ {
880885 class_element_is_decorated |= !method. decorators . is_empty ( )
881886 || Self :: class_method_parameter_is_decorated ( & method. value ) ;
882887
@@ -885,8 +890,8 @@ impl<'a> LegacyDecorator<'a, '_> {
885890 PrivateInExpressionDetector :: has_private_in_expression_in_method_decorator ( method) ;
886891 }
887892 }
888- ClassElement :: PropertyDefinition ( prop) if !prop. declare => {
889- class_element_is_decorated |= !prop . decorators . is_empty ( ) ;
893+ ClassElement :: PropertyDefinition ( prop) if !prop. decorators . is_empty ( ) => {
894+ class_element_is_decorated = true ;
890895
891896 if class_element_is_decorated && !has_private_in_expression_in_decorator {
892897 has_private_in_expression_in_decorator =
@@ -896,7 +901,7 @@ impl<'a> LegacyDecorator<'a, '_> {
896901 }
897902 }
898903 ClassElement :: AccessorProperty ( accessor) => {
899- class_element_is_decorated |= !accessor . decorators . is_empty ( ) ;
904+ class_element_is_decorated = true ;
900905
901906 if class_element_is_decorated && !has_private_in_expression_in_decorator {
902907 has_private_in_expression_in_decorator =
0 commit comments