do not try to classify missing nodes

This commit is contained in:
Vladimir Matveev 2015-06-23 11:25:33 -07:00
parent 644ea82ee3
commit 8e2b204ace
2 changed files with 18 additions and 0 deletions

View File

@ -6300,6 +6300,10 @@ namespace ts {
}
function classifyToken(token: Node): void {
if (nodeIsMissing(token)) {
return;
}
let tokenStart = classifyLeadingTriviaAndGetTokenStart(token);
let tokenWidth = token.end - tokenStart;

View File

@ -0,0 +1,14 @@
/// <reference path='fourslash.ts'/>
////class A {
//// a:
////}
////c =
let c = classification
verify.syntacticClassificationsAre(
c.keyword("class"), c.className("A"), c.punctuation("{"),
c.text("a"), c.punctuation(":"),
c.punctuation("}"),
c.text("c"), c.operator("=")
);