@@ -2198,14 +2198,14 @@ module ts {
2198
2198
function getTryCatchFinallyOccurrences ( tryStatement : TryStatement ) : ReferenceEntry [ ] {
2199
2199
var keywords : Node [ ] = [ ] ;
2200
2200
2201
- pushKeyword ( keywords , tryStatement . getFirstToken ( ) , SyntaxKind . TryKeyword ) ;
2201
+ pushKeywordIf ( keywords , tryStatement . getFirstToken ( ) , SyntaxKind . TryKeyword ) ;
2202
2202
2203
2203
if ( tryStatement . catchBlock ) {
2204
- pushKeyword ( keywords , tryStatement . catchBlock . getFirstToken ( ) , SyntaxKind . CatchKeyword ) ;
2204
+ pushKeywordIf ( keywords , tryStatement . catchBlock . getFirstToken ( ) , SyntaxKind . CatchKeyword ) ;
2205
2205
}
2206
2206
2207
2207
if ( tryStatement . finallyBlock ) {
2208
- pushKeyword ( keywords , tryStatement . finallyBlock . getFirstToken ( ) , SyntaxKind . FinallyKeyword ) ;
2208
+ pushKeywordIf ( keywords , tryStatement . finallyBlock . getFirstToken ( ) , SyntaxKind . FinallyKeyword ) ;
2209
2209
}
2210
2210
2211
2211
return keywordsToReferenceEntries ( keywords ) ;
@@ -2214,19 +2214,19 @@ module ts {
2214
2214
function getSwitchCaseDefaultOccurrences ( switchStatement : SwitchStatement ) {
2215
2215
var keywords : Node [ ] = [ ] ;
2216
2216
2217
- pushKeyword ( keywords , switchStatement . getFirstToken ( ) , SyntaxKind . SwitchKeyword ) ;
2217
+ pushKeywordIf ( keywords , switchStatement . getFirstToken ( ) , SyntaxKind . SwitchKeyword ) ;
2218
2218
2219
2219
// Go through each clause in the switch statement, collecting the clause keywords.
2220
2220
forEach ( switchStatement . clauses , clause => {
2221
- pushKeyword ( keywords , clause . getFirstToken ( ) , SyntaxKind . CaseKeyword , SyntaxKind . DefaultKeyword ) ;
2221
+ pushKeywordIf ( keywords , clause . getFirstToken ( ) , SyntaxKind . CaseKeyword , SyntaxKind . DefaultKeyword ) ;
2222
2222
2223
2223
// For each clause, also recursively traverse the statements where we can find analogous breaks.
2224
2224
forEachChild ( clause , function aggregateBreakKeywords ( node : Node ) : void {
2225
2225
switch ( node . kind ) {
2226
2226
case SyntaxKind . BreakStatement :
2227
2227
// If the break statement has a label, it cannot be part of a switch block.
2228
2228
if ( ! ( < BreakOrContinueStatement > node ) . label ) {
2229
- pushKeyword ( keywords , node . getFirstToken ( ) , SyntaxKind . BreakKeyword ) ;
2229
+ pushKeywordIf ( keywords , node . getFirstToken ( ) , SyntaxKind . BreakKeyword ) ;
2230
2230
}
2231
2231
// Fall through
2232
2232
case SyntaxKind . ForStatement :
@@ -2285,7 +2285,7 @@ module ts {
2285
2285
return node && node . parent ;
2286
2286
}
2287
2287
2288
- function pushKeyword ( keywordList : Node [ ] , token : Node , ...expected : SyntaxKind [ ] ) : void {
2288
+ function pushKeywordIf ( keywordList : Node [ ] , token : Node , ...expected : SyntaxKind [ ] ) : void {
2289
2289
if ( ! token ) {
2290
2290
return ;
2291
2291
}
0 commit comments