Better spans for import/export errors.

This commit is contained in:
Cyrus Najmabadi
2014-11-20 14:27:09 -08:00
parent 617fd2c5c9
commit c005c33244
18 changed files with 49 additions and 49 deletions
+2 -2
View File
@@ -4066,10 +4066,10 @@ module ts {
if (statement.kind === SyntaxKind.ExportAssignment) {
// Export assignments are not allowed in an internal module
return grammarErrorOnFirstToken(statement, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module);
return grammarErrorOnNode(statement, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module);
}
else if (statement.kind === SyntaxKind.ImportDeclaration && (<ImportDeclaration>statement).externalModuleName) {
return grammarErrorOnFirstToken(statement, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module);
return grammarErrorOnNode((<ImportDeclaration>statement).externalModuleName, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module);
}
}
}