Add assertion when classification has unexpected length

This commit is contained in:
Ben Lichtman 2019-10-10 16:28:41 -07:00
parent 35a6426a79
commit fcdd5bd782

View File

@ -499,8 +499,10 @@ namespace ts {
return { spans, endOfLineState: EndOfLineState.None };
function pushClassification(start: number, end: number, type: ClassificationType): void {
const length = end - start;
Debug.assert(length >= 0, `Classification had non-positive length of ${length}`);
spans.push(start);
spans.push(end - start);
spans.push(length);
spans.push(type);
}
}