@@ -582,7 +582,7 @@ module ts {
582
582
if (moduleSymbol) {
583
583
let exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]);
584
584
if (!exportDefaultSymbol) {
585
- error(node.name, Diagnostics.External_module_0_has_no_default_export , symbolToString(moduleSymbol));
585
+ error(node.name, Diagnostics.Module_0_has_no_default_export , symbolToString(moduleSymbol));
586
586
}
587
587
return exportDefaultSymbol;
588
588
}
@@ -870,10 +870,10 @@ module ts {
870
870
if (sourceFile.symbol) {
871
871
return sourceFile.symbol;
872
872
}
873
- error(moduleReferenceLiteral, Diagnostics.File_0_is_not_an_external_module , sourceFile.fileName);
873
+ error(moduleReferenceLiteral, Diagnostics.File_0_is_not_a_module , sourceFile.fileName);
874
874
return;
875
875
}
876
- error(moduleReferenceLiteral, Diagnostics.Cannot_find_external_module_0 , moduleName);
876
+ error(moduleReferenceLiteral, Diagnostics.Cannot_find_module_0 , moduleName);
877
877
}
878
878
879
879
// An external module with an 'export =' declaration resolves to the target of the 'export =' declaration,
@@ -888,7 +888,7 @@ module ts {
888
888
function resolveESModuleSymbol(moduleSymbol: Symbol, moduleReferenceExpression: Expression): Symbol {
889
889
let symbol = resolveExternalModuleSymbol(moduleSymbol);
890
890
if (symbol && !(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) {
891
- error(moduleReferenceExpression, Diagnostics.External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct , symbolToString(moduleSymbol));
891
+ error(moduleReferenceExpression, Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct , symbolToString(moduleSymbol));
892
892
symbol = undefined;
893
893
}
894
894
return symbol;
@@ -5508,7 +5508,7 @@ module ts {
5508
5508
5509
5509
switch (container.kind) {
5510
5510
case SyntaxKind.ModuleDeclaration:
5511
- error(node, Diagnostics.this_cannot_be_referenced_in_a_module_body );
5511
+ error(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body );
5512
5512
// do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks
5513
5513
break;
5514
5514
case SyntaxKind.EnumDeclaration:
@@ -9079,7 +9079,7 @@ module ts {
9079
9079
let parent = getDeclarationContainer(node);
9080
9080
if (parent.kind === SyntaxKind.SourceFile && isExternalModule(<SourceFile>parent)) {
9081
9081
// If the declaration happens to be in external module, report error that require and exports are reserved keywords
9082
- error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module ,
9082
+ error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module ,
9083
9083
declarationNameToString(name), declarationNameToString(name));
9084
9084
}
9085
9085
}
@@ -10494,10 +10494,10 @@ module ts {
10494
10494
let firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
10495
10495
if (firstNonAmbientClassOrFunc) {
10496
10496
if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
10497
- error(node.name, Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged );
10497
+ error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged );
10498
10498
}
10499
10499
else if (node.pos < firstNonAmbientClassOrFunc.pos) {
10500
- error(node.name, Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged );
10500
+ error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged );
10501
10501
}
10502
10502
}
10503
10503
@@ -10513,10 +10513,10 @@ module ts {
10513
10513
// Checks for ambient external modules.
10514
10514
if (node.name.kind === SyntaxKind.StringLiteral) {
10515
10515
if (!isGlobalSourceFile(node.parent)) {
10516
- error(node.name, Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules );
10516
+ error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules );
10517
10517
}
10518
10518
if (isExternalModuleNameRelative(node.name.text)) {
10519
- error(node.name, Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name );
10519
+ error(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name );
10520
10520
}
10521
10521
}
10522
10522
}
@@ -10548,16 +10548,16 @@ module ts {
10548
10548
let inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && (<ModuleDeclaration>node.parent.parent).name.kind === SyntaxKind.StringLiteral;
10549
10549
if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) {
10550
10550
error(moduleName, node.kind === SyntaxKind.ExportDeclaration ?
10551
- Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module :
10552
- Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module );
10551
+ Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
10552
+ Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module );
10553
10553
return false;
10554
10554
}
10555
10555
if (inAmbientExternalModule && isExternalModuleNameRelative((<LiteralExpression>moduleName).text)) {
10556
10556
// TypeScript 1.0 spec (April 2013): 12.1.6
10557
10557
// An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference
10558
10558
// other external modules only through top - level external module names.
10559
10559
// Relative external module names are not permitted.
10560
- error(node, Diagnostics.Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name );
10560
+ error(node, Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name );
10561
10561
return false;
10562
10562
}
10563
10563
return true;
@@ -10651,14 +10651,14 @@ module ts {
10651
10651
10652
10652
let inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && (<ModuleDeclaration>node.parent.parent).name.kind === SyntaxKind.StringLiteral;
10653
10653
if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) {
10654
- error(node, Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module );
10654
+ error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace );
10655
10655
}
10656
10656
}
10657
10657
else {
10658
10658
// export * from "foo"
10659
10659
let moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier);
10660
10660
if (moduleSymbol && moduleSymbol.exports["export="]) {
10661
- error(node.moduleSpecifier, Diagnostics.External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk , symbolToString(moduleSymbol));
10661
+ error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk , symbolToString(moduleSymbol));
10662
10662
}
10663
10663
}
10664
10664
}
@@ -10674,7 +10674,7 @@ module ts {
10674
10674
function checkExportAssignment(node: ExportAssignment) {
10675
10675
let container = node.parent.kind === SyntaxKind.SourceFile ? <SourceFile>node.parent : <ModuleDeclaration>node.parent.parent;
10676
10676
if (container.kind === SyntaxKind.ModuleDeclaration && (<ModuleDeclaration>container).name.kind === SyntaxKind.Identifier) {
10677
- error(node, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module );
10677
+ error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace );
10678
10678
return;
10679
10679
}
10680
10680
// Grammar checking
0 commit comments