Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fcdd5bd

Browse filesBrowse files
author
Ben Lichtman
committed
Add assertion when classification has unexpected length
1 parent 35a6426 commit fcdd5bd
Copy full SHA for fcdd5bd

1 file changed

+3-1Lines changed: 3 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/services/classifier.ts‎

Copy file name to clipboardExpand all lines: src/services/classifier.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,10 @@ namespace ts {
499499
return { spans, endOfLineState: EndOfLineState.None };
500500

501501
function pushClassification(start: number, end: number, type: ClassificationType): void {
502+
const length = end - start;
503+
Debug.assert(length >= 0, `Classification had non-positive length of ${length}`);
502504
spans.push(start);
503-
spans.push(end - start);
505+
spans.push(length);
504506
spans.push(type);
505507
}
506508
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.