@@ -50,21 +50,19 @@ function scrubFileTransformer(checker: ts.TypeChecker, isAngularCoreFile: boolea
50
50
return ts . forEachChild ( node , checkNodeForDecorators ) ;
51
51
}
52
52
const exprStmt = node as ts . ExpressionStatement ;
53
- if ( isDecoratorAssignmentExpression ( exprStmt ) ) {
53
+ // Do checks that don't need the typechecker first and bail early.
54
+ if ( isCtorParamsAssignmentExpression ( exprStmt ) ) {
55
+ nodes . push ( node ) ;
56
+ } else if ( isDecoratorAssignmentExpression ( exprStmt ) ) {
54
57
nodes . push ( ...pickDecorationNodesToRemove ( exprStmt , ngMetadata , checker ) ) ;
55
- }
56
- if ( isDecorateAssignmentExpression ( exprStmt , tslibImports , checker ) ) {
58
+ } else if ( isDecorateAssignmentExpression ( exprStmt , tslibImports , checker ) ) {
57
59
nodes . push ( ...pickDecorateNodesToRemove ( exprStmt , tslibImports , ngMetadata , checker ) ) ;
58
- }
59
- if ( isAngularDecoratorMetadataExpression ( exprStmt , ngMetadata , tslibImports , checker ) ) {
60
+ } else if ( isAngularDecoratorMetadataExpression ( exprStmt ,
61
+ ngMetadata , tslibImports , checker ) ) {
60
62
nodes . push ( node ) ;
61
- }
62
- if ( isPropDecoratorAssignmentExpression ( exprStmt ) ) {
63
+ } else if ( isPropDecoratorAssignmentExpression ( exprStmt ) ) {
63
64
nodes . push ( ...pickPropDecorationNodesToRemove ( exprStmt , ngMetadata , checker ) ) ;
64
65
}
65
- if ( isCtorParamsAssignmentExpression ( exprStmt ) ) {
66
- nodes . push ( node ) ;
67
- }
68
66
}
69
67
70
68
const visitor : ts . Visitor = ( node : ts . Node ) : ts . VisitResult < ts . Node > => {
0 commit comments