Move grammar checking: exportAssignment; there are still errors from incomplete grammar migration

This commit is contained in:
Yui T 2014-12-12 13:32:01 -08:00
parent afc04c8db8
commit 49bc20a05f
2 changed files with 6 additions and 1 deletions

View file

@ -8861,6 +8861,11 @@ module ts {
}
function checkExportAssignment(node: ExportAssignment) {
// Grammar checking
if (node.flags & NodeFlags.Modifier) {
grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers);
}
var container = node.parent;
if (container.kind !== SyntaxKind.SourceFile) {
// In a module, the immediate parent will be a block, so climb up one more parent

View file

@ -4642,7 +4642,7 @@ module ts {
case SyntaxKind.Constructor: return checkConstructor(<ConstructorDeclaration>node);
//case SyntaxKind.DeleteExpression: return checkDeleteExpression(<DeleteExpression> node);
//case SyntaxKind.ElementAccessExpression: return checkElementAccessExpression(<ElementAccessExpression>node);
case SyntaxKind.ExportAssignment: return checkExportAssignment(<ExportAssignment>node);
//case SyntaxKind.ExportAssignment: return checkExportAssignment(<ExportAssignment>node);
case SyntaxKind.ExternalModuleReference: return checkExternalModuleReference(<ExternalModuleReference>node);
case SyntaxKind.ForInStatement: return checkForInStatement(<ForInStatement>node);
case SyntaxKind.ForStatement: return checkForStatement(<ForStatement>node);