Fix scope of @typedef references (#16718)

* Fix scope of @typedef references

* Remove unused variables
This commit is contained in:
Andy
2017-06-28 13:30:23 -07:00
committed by GitHub
parent 9013665e22
commit 2ccfe502f7
2 changed files with 27 additions and 0 deletions

View File

@@ -275,6 +275,13 @@ namespace ts {
}
export function getContainerNode(node: Node): Declaration {
if (node.kind === SyntaxKind.JSDocTypedefTag) {
// This doesn't just apply to the node immediately under the comment, but to everything in its parent's scope.
// node.parent = the JSDoc comment, node.parent.parent = the node having the comment.
// Then we get parent again in the loop.
node = node.parent.parent;
}
while (true) {
node = node.parent;
if (!node) {