@@ -2198,14 +2198,14 @@ module ts {
21982198 function getTryCatchFinallyOccurrences ( tryStatement : TryStatement ) : ReferenceEntry [ ] {
21992199 var keywords : Node [ ] = [ ] ;
22002200
2201- pushKeyword ( keywords , tryStatement . getFirstToken ( ) , SyntaxKind . TryKeyword ) ;
2201+ pushKeywordIf ( keywords , tryStatement . getFirstToken ( ) , SyntaxKind . TryKeyword ) ;
22022202
22032203 if ( tryStatement . catchBlock ) {
2204- pushKeyword ( keywords , tryStatement . catchBlock . getFirstToken ( ) , SyntaxKind . CatchKeyword ) ;
2204+ pushKeywordIf ( keywords , tryStatement . catchBlock . getFirstToken ( ) , SyntaxKind . CatchKeyword ) ;
22052205 }
22062206
22072207 if ( tryStatement . finallyBlock ) {
2208- pushKeyword ( keywords , tryStatement . finallyBlock . getFirstToken ( ) , SyntaxKind . FinallyKeyword ) ;
2208+ pushKeywordIf ( keywords , tryStatement . finallyBlock . getFirstToken ( ) , SyntaxKind . FinallyKeyword ) ;
22092209 }
22102210
22112211 return keywordsToReferenceEntries ( keywords ) ;
@@ -2214,19 +2214,19 @@ module ts {
22142214 function getSwitchCaseDefaultOccurrences ( switchStatement : SwitchStatement ) {
22152215 var keywords : Node [ ] = [ ] ;
22162216
2217- pushKeyword ( keywords , switchStatement . getFirstToken ( ) , SyntaxKind . SwitchKeyword ) ;
2217+ pushKeywordIf ( keywords , switchStatement . getFirstToken ( ) , SyntaxKind . SwitchKeyword ) ;
22182218
22192219 // Go through each clause in the switch statement, collecting the clause keywords.
22202220 forEach ( switchStatement . clauses , clause => {
2221- pushKeyword ( keywords , clause . getFirstToken ( ) , SyntaxKind . CaseKeyword , SyntaxKind . DefaultKeyword ) ;
2221+ pushKeywordIf ( keywords , clause . getFirstToken ( ) , SyntaxKind . CaseKeyword , SyntaxKind . DefaultKeyword ) ;
22222222
22232223 // For each clause, also recursively traverse the statements where we can find analogous breaks.
22242224 forEachChild ( clause , function aggregateBreakKeywords ( node : Node ) : void {
22252225 switch ( node . kind ) {
22262226 case SyntaxKind . BreakStatement :
22272227 // If the break statement has a label, it cannot be part of a switch block.
22282228 if ( ! ( < BreakOrContinueStatement > node ) . label ) {
2229- pushKeyword ( keywords , node . getFirstToken ( ) , SyntaxKind . BreakKeyword ) ;
2229+ pushKeywordIf ( keywords , node . getFirstToken ( ) , SyntaxKind . BreakKeyword ) ;
22302230 }
22312231 // Fall through
22322232 case SyntaxKind . ForStatement :
@@ -2285,7 +2285,7 @@ module ts {
22852285 return node && node . parent ;
22862286 }
22872287
2288- function pushKeyword ( keywordList : Node [ ] , token : Node , ...expected : SyntaxKind [ ] ) : void {
2288+ function pushKeywordIf ( keywordList : Node [ ] , token : Node , ...expected : SyntaxKind [ ] ) : void {
22892289 if ( ! token ) {
22902290 return ;
22912291 }
0 commit comments