Merge pull request #33938 from uniqueiniquity/classifcationAssertion

Add assertion when classification has unexpected length
This commit is contained in:
Ben Lichtman
2019-10-18 09:44:51 -07:00
committed by GitHub

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);
}
}