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
commit 1bfc47252f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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