JsxText has no leading comments

This commit is contained in:
Arthur Ozga
2017-08-16 15:28:47 -07:00
parent ad9c29b928
commit 153b94aeb4
2 changed files with 28 additions and 1 deletions

View File

@@ -635,7 +635,7 @@ namespace ts {
}
export function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode: SourceFile) {
return getLeadingCommentRanges(sourceFileOfNode.text, node.pos);
return node.kind !== SyntaxKind.JsxText ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined;
}
export function getLeadingCommentRangesOfNodeFromText(node: Node, text: string) {