@@ -18449,7 +18449,7 @@ namespace ts {
18449
18449
18450
18450
// When resolved as an expression identifier, if the given node references an exported entity, return the declaration
18451
18451
// node of the exported entity's container. Otherwise, return undefined.
18452
- function getReferencedExportContainer(node: Identifier, prefixLocals?: boolean): SourceFile | ModuleDeclaration | EnumDeclaration {
18452
+ function getReferencedExportContainer(node: Identifier, prefixLocals?: boolean): SourceFile | ModuleDeclaration | EnumDeclaration | undefined {
18453
18453
node = getParseTreeNode(node, isIdentifier);
18454
18454
if (node) {
18455
18455
// When resolving the export container for the name of a module or enum
@@ -18471,10 +18471,11 @@ namespace ts {
18471
18471
const parentSymbol = getParentOfSymbol(symbol);
18472
18472
if (parentSymbol) {
18473
18473
if (parentSymbol.flags & SymbolFlags.ValueModule && parentSymbol.valueDeclaration.kind === SyntaxKind.SourceFile) {
18474
+ const symbolFile = <SourceFile>parentSymbol.valueDeclaration;
18475
+ const referenceFile = getSourceFileOfNode(node);
18474
18476
// If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined.
18475
- if (parentSymbol.valueDeclaration === getSourceFileOfNode(node)) {
18476
- return <SourceFile>parentSymbol.valueDeclaration;
18477
- }
18477
+ const symbolIsUmdExport = symbolFile !== referenceFile;
18478
+ return symbolIsUmdExport ? undefined : symbolFile;
18478
18479
}
18479
18480
for (let n = node.parent; n; n = n.parent) {
18480
18481
if (isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol) {
@@ -18484,8 +18485,6 @@ namespace ts {
18484
18485
}
18485
18486
}
18486
18487
}
18487
-
18488
- return undefined;
18489
18488
}
18490
18489
18491
18490
// When resolved as an expression identifier, if the given node references an import, return the declaration of
0 commit comments