File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -184,21 +184,22 @@ namespace ts {
184184 const lineStarts = getLineStarts ( sourceFile ) ;
185185
186186 const lineIndex = line ;
187+ const sourceText = sourceFile . text ;
187188 if ( lineIndex + 1 === lineStarts . length ) {
188189 // last line - return EOF
189- return sourceFile . text . length - 1 ;
190+ return sourceText . length - 1 ;
190191 }
191192 else {
192193 // current line start
193194 const start = lineStarts [ lineIndex ] ;
194- // take the start position of the next line -1 = it should be some line break
195+ // take the start position of the next line - 1 = it should be some line break
195196 let pos = lineStarts [ lineIndex + 1 ] - 1 ;
196- Debug . assert ( isLineBreak ( sourceFile . text . charCodeAt ( pos ) ) ) ;
197+ Debug . assert ( isLineBreak ( sourceText . charCodeAt ( pos ) ) ) ;
197198 // walk backwards skipping line breaks, stop the the beginning of current line.
198199 // i.e:
199200 // <some text>
200201 // $ <- end of line for this position should match the start position
201- while ( start <= pos && isLineBreak ( sourceFile . text . charCodeAt ( pos ) ) ) {
202+ while ( start <= pos && isLineBreak ( sourceText . charCodeAt ( pos ) ) ) {
202203 pos -- ;
203204 }
204205 return pos ;
You can’t perform that action at this time.
0 commit comments