mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-27 22:39:59 -05:00
Corrected token start position calculation & nodeHasTokens predicate.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user