mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 17:27:54 -05:00
Merge pull request #8485 from RyanCavanaugh/fix8478
Allow module augmentations to add new top-level names.
This commit is contained in:
@@ -15741,13 +15741,6 @@ namespace ts {
|
||||
grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
|
||||
break;
|
||||
case SyntaxKind.ImportEqualsDeclaration:
|
||||
if ((<ImportEqualsDeclaration>node).moduleReference.kind !== SyntaxKind.StringLiteral) {
|
||||
if (!isGlobalAugmentation) {
|
||||
error((<ImportEqualsDeclaration>node).name, Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
|
||||
break;
|
||||
@@ -15782,9 +15775,6 @@ namespace ts {
|
||||
// symbol should not originate in augmentation
|
||||
reportError = isExternalModuleAugmentation(symbol.parent.declarations[0]);
|
||||
}
|
||||
if (reportError) {
|
||||
error(node, Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1843,10 +1843,6 @@
|
||||
"category": "Error",
|
||||
"code": 2664
|
||||
},
|
||||
"Module augmentation cannot introduce new names in the top level scope.": {
|
||||
"category": "Error",
|
||||
"code": 2665
|
||||
},
|
||||
"Exports and export assignments are not permitted in module augmentations.": {
|
||||
"category": "Error",
|
||||
"code": 2666
|
||||
|
||||
Reference in New Issue
Block a user