Move grammar checking: functionDeclaration; there are still errors from incomplet grammar migration

This commit is contained in:
Yui T
2014-12-15 23:05:29 -08:00
parent 25a6302b48
commit 694771b2d7
5 changed files with 12 additions and 8 deletions

View File

@@ -7157,7 +7157,7 @@ module ts {
checkGrammarIndexSignature(<SignatureDeclaration>node);
}
// TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled
else if (node.kind === SyntaxKind.FunctionType || node.kind === SyntaxKind.ConstructorType ||
else if (node.kind === SyntaxKind.FunctionType || node.kind === SyntaxKind.FunctionDeclaration || node.kind === SyntaxKind.ConstructorType ||
node.kind === SyntaxKind.CallSignature || node.kind === SyntaxKind.Constructor ||
node.kind === SyntaxKind.ConstructSignature){
checkGrammarFunctionLikeDeclaration(<FunctionLikeDeclaration>node);
@@ -7764,7 +7764,11 @@ module ts {
}
function checkFunctionDeclaration(node: FunctionDeclaration): void {
// Grammar Checking, check signature of function declaration as checkFunctionLikeDeclaration call checkGarmmarFunctionLikeDeclaration
checkFunctionLikeDeclaration(node);
//Grammar check other component of the functionDeclaration
checkGrammarFunctionName(node.name) || checkGrammarForBodyInAmbientContext(node.body, /*isConstructor*/ false) || checkGrammarForGenerator(node);
if (fullTypeCheck) {
checkCollisionWithCapturedSuperVariable(node, node.name);
checkCollisionWithCapturedThisVariable(node, node.name);

View File

@@ -4646,7 +4646,7 @@ module ts {
//case SyntaxKind.ExternalModuleReference: return checkExternalModuleReference(<ExternalModuleReference>node);
//case SyntaxKind.ForInStatement: return checkForInStatement(<ForInStatement>node);
//case SyntaxKind.ForStatement: return checkForStatement(<ForStatement>node);
case SyntaxKind.FunctionDeclaration: return checkFunctionDeclaration(<FunctionLikeDeclaration>node);
//case SyntaxKind.FunctionDeclaration: return checkFunctionDeclaration(<FunctionLikeDeclaration>node);
//case SyntaxKind.FunctionExpression: return checkFunctionExpression(<FunctionExpression>node);
case SyntaxKind.GetAccessor: return checkGetAccessor(<MethodDeclaration>node);
//case SyntaxKind.HeritageClause: return checkHeritageClause(<HeritageClause>node);
@@ -5334,7 +5334,7 @@ module ts {
//case SyntaxKind.EnumDeclaration:
case SyntaxKind.ExportAssignment:
//case SyntaxKind.VariableStatement:
case SyntaxKind.FunctionDeclaration:
//case SyntaxKind.FunctionDeclaration:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.ImportDeclaration:
//case SyntaxKind.Parameter: