Corrected token start position calculation & nodeHasTokens predicate.

This commit is contained in:
Daniel Rosenwasser
2014-11-12 15:10:57 -08:00
parent a390afb4f5
commit 32f6cf33ce
2 changed files with 7 additions and 10 deletions

View File

@@ -40,6 +40,9 @@ module ts {
}
export function getTokenPosOfNode(node: Node, sourceFile?: SourceFile): number {
if (node.pos === node.end) {
return node.pos;
}
return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos);
}