Fixed issue where parser improperly parses a function declaration with no identifier.

This commit is contained in:
Daniel Rosenwasser
2014-09-17 15:28:41 -07:00
parent d6888b2834
commit e69b9e6362
4 changed files with 12 additions and 9 deletions

View File

@@ -5379,6 +5379,10 @@ module ts {
var isConstructor = (symbol.flags & SymbolFlags.Constructor) !== 0;
function reportImplementationExpectedError(node: FunctionDeclaration): void {
if (node.name && node.name.kind === SyntaxKind.Missing) {
return;
}
var seen = false;
var subsequentNode = forEachChild(node.parent, c => {
if (seen) {

View File

@@ -953,7 +953,10 @@ module ts {
return finishNode(node);
}
error(Diagnostics.Identifier_expected);
return <Identifier>createMissingNode();
var node = <Identifier>createMissingNode();
node.text = "";
return node;
}
function parseIdentifier(): Identifier {