@@ -80,7 +80,7 @@ namespace ts.server {
8080 const lines = lm . lines ;
8181 if ( lines . length > 1 ) {
8282 if ( lines [ lines . length - 1 ] === "" ) {
83- lines . length -- ;
83+ lines . pop ( ) ;
8484 }
8585 }
8686 let branchParent : LineNode ;
@@ -157,7 +157,7 @@ namespace ts.server {
157157 this . state = CharRangeSection . End ;
158158 }
159159 // always pop stack because post only called when child has been visited
160- this . stack . length -- ;
160+ this . stack . pop ( ) ;
161161 return undefined ;
162162 }
163163
@@ -193,20 +193,20 @@ namespace ts.server {
193193 else {
194194 child = fresh ( lineCollection ) ;
195195 currentNode . add ( child ) ;
196- this . startPath [ this . startPath . length ] = child ;
196+ this . startPath . push ( child ) ;
197197 }
198198 break ;
199199 case CharRangeSection . Entire :
200200 if ( this . state !== CharRangeSection . End ) {
201201 child = fresh ( lineCollection ) ;
202202 currentNode . add ( child ) ;
203- this . startPath [ this . startPath . length ] = child ;
203+ this . startPath . push ( child ) ;
204204 }
205205 else {
206206 if ( ! lineCollection . isLeaf ( ) ) {
207207 child = fresh ( lineCollection ) ;
208208 currentNode . add ( child ) ;
209- this . endBranch [ this . endBranch . length ] = child ;
209+ this . endBranch . push ( child ) ;
210210 }
211211 }
212212 break ;
@@ -221,7 +221,7 @@ namespace ts.server {
221221 if ( ! lineCollection . isLeaf ( ) ) {
222222 child = fresh ( lineCollection ) ;
223223 currentNode . add ( child ) ;
224- this . endBranch [ this . endBranch . length ] = child ;
224+ this . endBranch . push ( child ) ;
225225 }
226226 }
227227 break ;
@@ -233,7 +233,7 @@ namespace ts.server {
233233 break ;
234234 }
235235 if ( this . goSubtree ) {
236- this . stack [ this . stack . length ] = < LineNode > child ;
236+ this . stack . push ( < LineNode > child ) ;
237237 }
238238 return lineCollection ;
239239 }
@@ -289,7 +289,7 @@ namespace ts.server {
289289
290290 // REVIEW: can optimize by coalescing simple edits
291291 edit ( pos : number , deleteLen : number , insertedText ?: string ) {
292- this . changes [ this . changes . length ] = new TextChange ( pos , deleteLen , insertedText ) ;
292+ this . changes . push ( new TextChange ( pos , deleteLen , insertedText ) ) ;
293293 if ( ( this . changes . length > ScriptVersionCache . changeNumberThreshold ) ||
294294 ( deleteLen > ScriptVersionCache . changeLengthThreshold ) ||
295295 ( insertedText && ( insertedText . length > ScriptVersionCache . changeLengthThreshold ) ) ) {
@@ -366,7 +366,7 @@ namespace ts.server {
366366 for ( let i = oldVersion + 1 ; i <= newVersion ; i ++ ) {
367367 const snap = this . versions [ this . versionToIndex ( i ) ] ;
368368 for ( const textChange of snap . changesSincePreviousVersion ) {
369- textChangeRanges [ textChangeRanges . length ] = textChange . getTextChangeRange ( ) ;
369+ textChangeRanges . push ( textChange . getTextChangeRange ( ) ) ;
370370 }
371371 }
372372 return ts . collapseTextChangeRangesAcrossMultipleVersions ( textChangeRanges ) ;
@@ -623,7 +623,7 @@ namespace ts.server {
623623 lines [ lc ] = endText ;
624624 }
625625 else {
626- lines . length -- ;
626+ lines . pop ( ) ;
627627 }
628628 return { lines, lineMap } ;
629629 }
@@ -836,7 +836,7 @@ namespace ts.server {
836836 this . children [ i ] = this . children [ i + 1 ] ;
837837 }
838838 }
839- this . children . length -- ;
839+ this . children . pop ( ) ;
840840 }
841841
842842 private findChildIndex ( child : LineCollection ) {
@@ -884,12 +884,12 @@ namespace ts.server {
884884 }
885885 for ( let i = splitNodes . length - 1 ; i >= 0 ; i -- ) {
886886 if ( splitNodes [ i ] . children . length === 0 ) {
887- splitNodes . length -- ;
887+ splitNodes . pop ( ) ;
888888 }
889889 }
890890 }
891891 if ( shiftNode ) {
892- splitNodes [ splitNodes . length ] = shiftNode ;
892+ splitNodes . push ( shiftNode ) ;
893893 }
894894 this . updateCounts ( ) ;
895895 for ( let i = 0 ; i < splitNodeCount ; i ++ ) {
@@ -901,7 +901,7 @@ namespace ts.server {
901901
902902 // assume there is room for the item; return true if more room
903903 add ( collection : LineCollection ) {
904- this . children [ this . children . length ] = collection ;
904+ this . children . push ( collection ) ;
905905 return ( this . children . length < lineCollectionCapacity ) ;
906906 }
907907
0 commit comments