@@ -196,8 +196,7 @@ module ts {
196196 var list = createNode ( SyntaxKind . SyntaxList , nodes . pos , nodes . end , NodeFlags . Synthetic , this ) ;
197197 list . _children = [ ] ;
198198 var pos = nodes . pos ;
199- for ( var i = 0 , len = nodes . length ; i < len ; i ++ ) {
200- var node = nodes [ i ] ;
199+ for ( let node of nodes ) {
201200 if ( pos < node . pos ) {
202201 pos = this . addSyntheticNodes ( list . _children , pos , node . pos ) ;
203202 }
@@ -255,8 +254,7 @@ module ts {
255254
256255 public getFirstToken ( sourceFile ?: SourceFile ) : Node {
257256 var children = this . getChildren ( ) ;
258- for ( var i = 0 ; i < children . length ; i ++ ) {
259- var child = children [ i ] ;
257+ for ( let child of children ) {
260258 if ( child . kind < SyntaxKind . FirstNode ) {
261259 return child ;
262260 }
@@ -1523,8 +1521,8 @@ module ts {
15231521
15241522 // Initialize the list with the root file names
15251523 var rootFileNames = host . getScriptFileNames ( ) ;
1526- for ( var i = 0 , n = rootFileNames . length ; i < n ; i ++ ) {
1527- this . createEntry ( rootFileNames [ i ] ) ;
1524+ for ( let fileName of rootFileNames ) {
1525+ this . createEntry ( fileName ) ;
15281526 }
15291527
15301528 // store the compilation settings
@@ -2252,8 +2250,8 @@ module ts {
22522250 // not part of the new program.
22532251 if ( program ) {
22542252 var oldSourceFiles = program . getSourceFiles ( ) ;
2255- for ( var i = 0 , n = oldSourceFiles . length ; i < n ; i ++ ) {
2256- var fileName = oldSourceFiles [ i ] . fileName ;
2253+ for ( let oldSourceFile of oldSourceFiles ) {
2254+ var fileName = oldSourceFile . fileName ;
22572255 if ( ! newProgram . getSourceFile ( fileName ) || changesInCompilationSettingsAffectSyntax ) {
22582256 documentRegistry . releaseDocument ( fileName , oldSettings ) ;
22592257 }
@@ -2329,8 +2327,8 @@ module ts {
23292327 }
23302328
23312329 // If any file is not up-to-date, then the whole program is not up-to-date
2332- for ( var i = 0 , n = rootFileNames . length ; i < n ; i ++ ) {
2333- if ( ! sourceFileUpToDate ( program . getSourceFile ( rootFileNames [ i ] ) ) ) {
2330+ for ( let fileName of rootFileNames ) {
2331+ if ( ! sourceFileUpToDate ( program . getSourceFile ( fileName ) ) ) {
23342332 return false ;
23352333 }
23362334 }
@@ -4314,8 +4312,8 @@ module ts {
43144312
43154313 var declarations = symbol . getDeclarations ( ) ;
43164314 if ( declarations ) {
4317- for ( var i = 0 , n = declarations . length ; i < n ; i ++ ) {
4318- var container = getContainerNode ( declarations [ i ] ) ;
4315+ for ( let declaration of declarations ) {
4316+ var container = getContainerNode ( declaration ) ;
43194317
43204318 if ( ! container ) {
43214319 return undefined ;
@@ -4831,8 +4829,8 @@ module ts {
48314829 // Remember the last meaning
48324830 var lastIterationMeaning = meaning ;
48334831
4834- for ( var i = 0 , n = declarations . length ; i < n ; i ++ ) {
4835- var declarationMeaning = getMeaningFromDeclaration ( declarations [ i ] ) ;
4832+ for ( let declaration of declarations ) {
4833+ var declarationMeaning = getMeaningFromDeclaration ( declaration ) ;
48364834
48374835 if ( declarationMeaning & meaning ) {
48384836 meaning |= declarationMeaning ;
@@ -5401,8 +5399,7 @@ module ts {
54015399 // Ignore nodes that don't intersect the original span to classify.
54025400 if ( textSpanIntersectsWith ( span , element . getFullStart ( ) , element . getFullWidth ( ) ) ) {
54035401 var children = element . getChildren ( ) ;
5404- for ( var i = 0 , n = children . length ; i < n ; i ++ ) {
5405- var child = children [ i ] ;
5402+ for ( let child of children ) {
54065403 if ( isToken ( child ) ) {
54075404 classifyToken ( child ) ;
54085405 }
@@ -5435,9 +5432,7 @@ module ts {
54355432 var parentElement = token . parent ;
54365433
54375434 var childNodes = parentElement . getChildren ( sourceFile ) ;
5438- for ( var i = 0 , n = childNodes . length ; i < n ; i ++ ) {
5439- var current = childNodes [ i ] ;
5440-
5435+ for ( let current of childNodes ) {
54415436 if ( current . kind === matchKind ) {
54425437 var range1 = createTextSpan ( token . getStart ( sourceFile ) , token . getWidth ( sourceFile ) ) ;
54435438 var range2 = createTextSpan ( current . getStart ( sourceFile ) , current . getWidth ( sourceFile ) ) ;
0 commit comments