Merge pull request #5566 from jeffreymorlan/fix5444

Fix issue #5444
This commit is contained in:
Daniel Rosenwasser
2015-11-28 12:00:26 -08:00
4 changed files with 104 additions and 1 deletions

View File

@@ -11439,7 +11439,9 @@ namespace ts {
seen = c === node;
}
});
if (subsequentNode) {
// We may be here because of some extra junk between overloads that could not be parsed into a valid node.
// In this case the subsequent node is not really consecutive (.pos !== node.end), and we must ignore it here.
if (subsequentNode && subsequentNode.pos === node.end) {
if (subsequentNode.kind === node.kind) {
const errorNode: Node = (<FunctionLikeDeclaration>subsequentNode).name || subsequentNode;
// TODO(jfreeman): These are methods, so handle computed name case