mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Move grammar checking: functionDeclaration; there are still errors from incomplet grammar migration
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user