Fix lint failures

This commit is contained in:
Mohamed Hegazy
2016-03-29 14:04:21 -07:00
parent 155f4879de
commit 6e739d37d4

View File

@@ -181,16 +181,16 @@ namespace ts {
export function getEndLinePosition(line: number, sourceFile: SourceFile): number {
Debug.assert(line >= 0);
let lineStarts = getLineStarts(sourceFile);
const lineStarts = getLineStarts(sourceFile);
let lineIndex = line;
const lineIndex = line;
if (lineIndex + 1 === lineStarts.length) {
// last line - return EOF
return sourceFile.text.length - 1;
}
else {
// current line start
let start = lineStarts[lineIndex];
const start = lineStarts[lineIndex];
// take the start position of the next line -1 = it should be some line break
let pos = lineStarts[lineIndex + 1] - 1;
Debug.assert(isLineBreak(sourceFile.text.charCodeAt(pos)));