@@ -629,7 +629,7 @@ namespace ts.server {
629
629
for ( var i = 0 , len = this . openFilesReferenced . length ; i < len ; i ++ ) {
630
630
var f = this . openFilesReferenced [ i ] ;
631
631
// if f was referenced by the removed project, remember it
632
- if ( f . defaultProject == removedProject ) {
632
+ if ( f . defaultProject === removedProject ) {
633
633
f . defaultProject = undefined ;
634
634
orphanFiles . push ( f ) ;
635
635
}
@@ -656,7 +656,7 @@ namespace ts.server {
656
656
for ( var i = 0 , len = this . inferredProjects . length ; i < len ; i ++ ) {
657
657
var inferredProject = this . inferredProjects [ i ] ;
658
658
inferredProject . updateGraph ( ) ;
659
- if ( inferredProject != excludedProject ) {
659
+ if ( inferredProject !== excludedProject ) {
660
660
if ( inferredProject . getSourceFile ( info ) ) {
661
661
info . defaultProject = inferredProject ;
662
662
referencingProjects . push ( inferredProject ) ;
@@ -710,7 +710,7 @@ namespace ts.server {
710
710
var rootFile = this . openFileRoots [ i ] ;
711
711
var rootedProject = rootFile . defaultProject ;
712
712
var referencingProjects = this . findReferencingProjects ( rootFile , rootedProject ) ;
713
- if ( referencingProjects . length == 0 ) {
713
+ if ( referencingProjects . length === 0 ) {
714
714
rootFile . defaultProject = rootedProject ;
715
715
openFileRoots . push ( rootFile ) ;
716
716
}
@@ -1082,7 +1082,7 @@ namespace ts.server {
1082
1082
1083
1083
for ( var k = this . endBranch . length - 1 ; k >= 0 ; k -- ) {
1084
1084
( < LineNode > this . endBranch [ k ] ) . updateCounts ( ) ;
1085
- if ( this . endBranch [ k ] . charCount ( ) == 0 ) {
1085
+ if ( this . endBranch [ k ] . charCount ( ) === 0 ) {
1086
1086
lastZeroCount = this . endBranch [ k ] ;
1087
1087
if ( k > 0 ) {
1088
1088
branchParent = < LineNode > this . endBranch [ k - 1 ] ;
@@ -1147,7 +1147,7 @@ namespace ts.server {
1147
1147
post ( relativeStart : number , relativeLength : number , lineCollection : LineCollection , parent : LineCollection , nodeType : CharRangeSection ) : LineCollection {
1148
1148
// have visited the path for start of range, now looking for end
1149
1149
// if range is on single line, we will never make this state transition
1150
- if ( lineCollection == this . lineCollectionAtBranch ) {
1150
+ if ( lineCollection === this . lineCollectionAtBranch ) {
1151
1151
this . state = CharRangeSection . End ;
1152
1152
}
1153
1153
// always pop stack because post only called when child has been visited
@@ -1159,7 +1159,7 @@ namespace ts.server {
1159
1159
// currentNode corresponds to parent, but in the new tree
1160
1160
var currentNode = this . stack [ this . stack . length - 1 ] ;
1161
1161
1162
- if ( ( this . state == CharRangeSection . Entire ) && ( nodeType == CharRangeSection . Start ) ) {
1162
+ if ( ( this . state === CharRangeSection . Entire ) && ( nodeType = == CharRangeSection . Start ) ) {
1163
1163
// if range is on single line, we will never make this state transition
1164
1164
this . state = CharRangeSection . Start ;
1165
1165
this . branchNode = currentNode ;
@@ -1176,12 +1176,12 @@ namespace ts.server {
1176
1176
switch ( nodeType ) {
1177
1177
case CharRangeSection . PreStart :
1178
1178
this . goSubtree = false ;
1179
- if ( this . state != CharRangeSection . End ) {
1179
+ if ( this . state !== CharRangeSection . End ) {
1180
1180
currentNode . add ( lineCollection ) ;
1181
1181
}
1182
1182
break ;
1183
1183
case CharRangeSection . Start :
1184
- if ( this . state == CharRangeSection . End ) {
1184
+ if ( this . state === CharRangeSection . End ) {
1185
1185
this . goSubtree = false ;
1186
1186
}
1187
1187
else {
@@ -1191,7 +1191,7 @@ namespace ts.server {
1191
1191
}
1192
1192
break ;
1193
1193
case CharRangeSection . Entire :
1194
- if ( this . state != CharRangeSection . End ) {
1194
+ if ( this . state !== CharRangeSection . End ) {
1195
1195
child = fresh ( lineCollection ) ;
1196
1196
currentNode . add ( child ) ;
1197
1197
this . startPath [ this . startPath . length ] = child ;
@@ -1208,7 +1208,7 @@ namespace ts.server {
1208
1208
this . goSubtree = false ;
1209
1209
break ;
1210
1210
case CharRangeSection . End :
1211
- if ( this . state != CharRangeSection . End ) {
1211
+ if ( this . state !== CharRangeSection . End ) {
1212
1212
this . goSubtree = false ;
1213
1213
}
1214
1214
else {
@@ -1221,7 +1221,7 @@ namespace ts.server {
1221
1221
break ;
1222
1222
case CharRangeSection . PostEnd :
1223
1223
this . goSubtree = false ;
1224
- if ( this . state != CharRangeSection . Start ) {
1224
+ if ( this . state !== CharRangeSection . Start ) {
1225
1225
currentNode . add ( lineCollection ) ;
1226
1226
}
1227
1227
break ;
@@ -1233,10 +1233,10 @@ namespace ts.server {
1233
1233
}
1234
1234
// just gather text from the leaves
1235
1235
leaf ( relativeStart : number , relativeLength : number , ll : LineLeaf ) {
1236
- if ( this . state == CharRangeSection . Start ) {
1236
+ if ( this . state === CharRangeSection . Start ) {
1237
1237
this . initialText = ll . text . substring ( 0 , relativeStart ) ;
1238
1238
}
1239
- else if ( this . state == CharRangeSection . Entire ) {
1239
+ else if ( this . state === CharRangeSection . Entire ) {
1240
1240
this . initialText = ll . text . substring ( 0 , relativeStart ) ;
1241
1241
this . trailingText = ll . text . substring ( relativeStart + relativeLength ) ;
1242
1242
}
@@ -1499,8 +1499,8 @@ namespace ts.server {
1499
1499
function editFlat ( source : string , s : number , dl : number , nt = "" ) {
1500
1500
return source . substring ( 0 , s ) + nt + source . substring ( s + dl , source . length ) ;
1501
1501
}
1502
- if ( this . root . charCount ( ) == 0 ) {
1503
- // TODO: assert deleteLength == 0
1502
+ if ( this . root . charCount ( ) === 0 ) {
1503
+ // TODO: assert deleteLength === 0
1504
1504
if ( newText ) {
1505
1505
this . load ( LineIndex . linesFromText ( newText ) . lines ) ;
1506
1506
return this ;
@@ -1528,7 +1528,7 @@ namespace ts.server {
1528
1528
// check whether last characters deleted are line break
1529
1529
var e = pos + deleteLength ;
1530
1530
var lineInfo = this . charOffsetToLineNumberAndPos ( e ) ;
1531
- if ( ( lineInfo && ( lineInfo . offset == 0 ) ) ) {
1531
+ if ( ( lineInfo && ( lineInfo . offset === 0 ) ) ) {
1532
1532
// move range end just past line that will merge with previous line
1533
1533
deleteLength += lineInfo . text . length ;
1534
1534
// store text by appending to end of insertedText
@@ -1574,7 +1574,7 @@ namespace ts.server {
1574
1574
interiorNodes [ i ] . totalChars = charCount ;
1575
1575
interiorNodes [ i ] . totalLines = lineCount ;
1576
1576
}
1577
- if ( interiorNodes . length == 1 ) {
1577
+ if ( interiorNodes . length === 1 ) {
1578
1578
return interiorNodes [ 0 ] ;
1579
1579
}
1580
1580
else {
@@ -1585,7 +1585,7 @@ namespace ts.server {
1585
1585
static linesFromText ( text : string ) {
1586
1586
var lineStarts = ts . computeLineStarts ( text ) ;
1587
1587
1588
- if ( lineStarts . length == 0 ) {
1588
+ if ( lineStarts . length === 0 ) {
1589
1589
return { lines : < string [ ] > [ ] , lineMap : lineStarts } ;
1590
1590
}
1591
1591
var lines = < string [ ] > new Array ( lineStarts . length ) ;
@@ -1821,7 +1821,7 @@ namespace ts.server {
1821
1821
findChildIndex ( child : LineCollection ) {
1822
1822
var childIndex = 0 ;
1823
1823
var clen = this . children . length ;
1824
- while ( ( this . children [ childIndex ] != child ) && ( childIndex < clen ) ) childIndex ++ ;
1824
+ while ( ( this . children [ childIndex ] !== child ) && ( childIndex < clen ) ) childIndex ++ ;
1825
1825
return childIndex ;
1826
1826
}
1827
1827
@@ -1830,7 +1830,7 @@ namespace ts.server {
1830
1830
var clen = this . children . length ;
1831
1831
var nodeCount = nodes . length ;
1832
1832
// if child is last and there is more room and only one node to place, place it
1833
- if ( ( clen < lineCollectionCapacity ) && ( childIndex == ( clen - 1 ) ) && ( nodeCount == 1 ) ) {
1833
+ if ( ( clen < lineCollectionCapacity ) && ( childIndex === ( clen - 1 ) ) && ( nodeCount = == 1 ) ) {
1834
1834
this . add ( nodes [ 0 ] ) ;
1835
1835
this . updateCounts ( ) ;
1836
1836
return [ ] ;
@@ -1854,13 +1854,13 @@ namespace ts.server {
1854
1854
var splitNode = < LineNode > splitNodes [ 0 ] ;
1855
1855
while ( nodeIndex < nodeCount ) {
1856
1856
splitNode . add ( nodes [ nodeIndex ++ ] ) ;
1857
- if ( splitNode . children . length == lineCollectionCapacity ) {
1857
+ if ( splitNode . children . length === lineCollectionCapacity ) {
1858
1858
splitNodeIndex ++ ;
1859
1859
splitNode = < LineNode > splitNodes [ splitNodeIndex ] ;
1860
1860
}
1861
1861
}
1862
1862
for ( i = splitNodes . length - 1 ; i >= 0 ; i -- ) {
1863
- if ( splitNodes [ i ] . children . length == 0 ) {
1863
+ if ( splitNodes [ i ] . children . length === 0 ) {
1864
1864
splitNodes . length -- ;
1865
1865
}
1866
1866
}
0 commit comments