We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c8e351 commit 24753c4Copy full SHA for 24753c4
1 file changed
src/compiler/scanner.ts
@@ -319,10 +319,10 @@ namespace ts {
319
}
320
321
/* @internal */
322
+ /**
323
+ * We assume the first line starts at position 0 and 'position' is non-negative.
324
+ */
325
export function computeLineAndCharacterOfPosition(lineStarts: number[], position: number) {
- Debug.assert(lineStarts.length && lineStarts[0] === 0, "the first line should start at position 0");
- Debug.assert(0 <= position, "position should be positive");
-
326
let lineNumber = binarySearch(lineStarts, position);
327
if (lineNumber < 0) {
328
// If the actual position was not found,
0 commit comments