mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Merge pull request #13913 from Microsoft/allowExportDeclarationsInAmbientNamespaces
Allow export declarations in ambient namespaces
This commit is contained in:
@@ -19540,7 +19540,9 @@ namespace ts {
|
||||
forEach(node.exportClause.elements, checkExportSpecifier);
|
||||
|
||||
const inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && isAmbientModule(node.parent.parent);
|
||||
if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) {
|
||||
const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === SyntaxKind.ModuleBlock &&
|
||||
!node.moduleSpecifier && isInAmbientContext(node);
|
||||
if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
|
||||
error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user