@@ -76,19 +76,18 @@ namespace ts {
7676 }
7777
7878 function visitFile ( sourceFile : SourceFile ) : void {
79- let hasDecorators = ! ! ( sourceFile . transformFlags & TransformFlags . ContainsDecorators ) ;
8079 let statements = sourceFile . statements ;
8180 let length = statements . length ;
8281 for ( let i = 0 ; i < length ; i ++ ) {
8382 let statement = statements [ i ] ;
8483 if ( hasModifier ( statement , ModifierFlags . Ambient ) ) { // has the 'declare' keyword
8584 continue ;
8685 }
87- visitStatement ( statements [ i ] , hasDecorators ) ;
86+ visitStatement ( statements [ i ] ) ;
8887 }
8988 }
9089
91- function visitStatement ( statement : Statement , hasDecorators ?: boolean ) : void {
90+ function visitStatement ( statement : Statement ) : void {
9291 if ( ! statement ) {
9392 return ;
9493 }
@@ -100,7 +99,7 @@ namespace ts {
10099 case SyntaxKind . ClassDeclaration :
101100 checkInheriting ( < ClassDeclaration > statement ) ;
102101 visitStaticMember ( < ClassDeclaration > statement ) ;
103- if ( hasDecorators ) {
102+ if ( statement . transformFlags & TransformFlags . ContainsDecorators ) {
104103 visitClassDecorators ( < ClassDeclaration > statement ) ;
105104 }
106105 break ;
@@ -112,7 +111,7 @@ namespace ts {
112111 checkDependencyAtLocation ( importDeclaration . moduleReference ) ;
113112 break ;
114113 case SyntaxKind . ModuleDeclaration :
115- visitModule ( < ModuleDeclaration > statement , hasDecorators ) ;
114+ visitModule ( < ModuleDeclaration > statement ) ;
116115 break ;
117116 case SyntaxKind . Block :
118117 visitBlock ( < Block > statement ) ;
@@ -188,7 +187,7 @@ namespace ts {
188187 }
189188 }
190189
191- function visitModule ( node : ModuleDeclaration , hasDecorators ?: boolean ) : void {
190+ function visitModule ( node : ModuleDeclaration ) : void {
192191 if ( node . body . kind === SyntaxKind . ModuleDeclaration ) {
193192 visitModule ( < ModuleDeclaration > node . body ) ;
194193 return ;
@@ -198,7 +197,7 @@ namespace ts {
198197 if ( hasModifier ( statement , ModifierFlags . Ambient ) ) { // has the 'declare' keyword
199198 continue ;
200199 }
201- visitStatement ( statement , hasDecorators ) ;
200+ visitStatement ( statement ) ;
202201 }
203202 }
204203
0 commit comments