@@ -50,21 +50,19 @@ function scrubFileTransformer(checker: ts.TypeChecker, isAngularCoreFile: boolea
5050 return ts . forEachChild ( node , checkNodeForDecorators ) ;
5151 }
5252 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 ) ) {
5457 nodes . push ( ...pickDecorationNodesToRemove ( exprStmt , ngMetadata , checker ) ) ;
55- }
56- if ( isDecorateAssignmentExpression ( exprStmt , tslibImports , checker ) ) {
58+ } else if ( isDecorateAssignmentExpression ( exprStmt , tslibImports , checker ) ) {
5759 nodes . push ( ...pickDecorateNodesToRemove ( exprStmt , tslibImports , ngMetadata , checker ) ) ;
58- }
59- if ( isAngularDecoratorMetadataExpression ( exprStmt , ngMetadata , tslibImports , checker ) ) {
60+ } else if ( isAngularDecoratorMetadataExpression ( exprStmt ,
61+ ngMetadata , tslibImports , checker ) ) {
6062 nodes . push ( node ) ;
61- }
62- if ( isPropDecoratorAssignmentExpression ( exprStmt ) ) {
63+ } else if ( isPropDecoratorAssignmentExpression ( exprStmt ) ) {
6364 nodes . push ( ...pickPropDecorationNodesToRemove ( exprStmt , ngMetadata , checker ) ) ;
6465 }
65- if ( isCtorParamsAssignmentExpression ( exprStmt ) ) {
66- nodes . push ( node ) ;
67- }
6866 }
6967
7068 const visitor : ts . Visitor = ( node : ts . Node ) : ts . VisitResult < ts . Node > => {
0 commit comments