Uh oh!
There was an error while loading. Please reload this page.
Run fixupParentReferences when parsing isolated jsDocComment - #8930
Conversation
| forEachChild(result.jsDocComment, visitNode); | ||
| function visitNode(n: Node): void { | ||
| if (n.parent !== parentNode) { |
There was a problem hiding this comment.
I'd expect the check here to be n.parent === undefined. Is there ever a case where the node has a parent but it's not the current parent? That seems like it should never happen.
There was a problem hiding this comment.
I think this might happen during incremental parsing; however as the jsDocComment is parsed in isolation, it is always parsed from scratch, so you are right that it should never happen. Will update.
Ryan Cavanaugh (RyanCavanaugh)
commented
Jun 2, 2016
👍 |
| if (result && result.jsDocComment) { | ||
| // because the jsDocComment was parsed out of the source file, it might | ||
| // not be covered by the fixupParentReferences. | ||
| let parentNode: Node = result.jsDocComment; |
There was a problem hiding this comment.
can you just call fixupParentReferences here and pass result.jsDocComment as a parameter instead of copying the code?
There was a problem hiding this comment.
That would be better, as I was thinking the fixupParentReferences was supposed to be called only for sourceFile nodes. Changing that.
Vladimir Matveev (vladima)
commented
Jun 2, 2016
👍 |
Fix#8676