@@ -3069,20 +3069,9 @@ namespace ts {
3069
3069
function resolveExternalModuleSymbol(moduleSymbol: Symbol | undefined, dontResolveAlias?: boolean): Symbol | undefined;
3070
3070
function resolveExternalModuleSymbol(moduleSymbol: Symbol, dontResolveAlias?: boolean): Symbol {
3071
3071
if (moduleSymbol) {
3072
- const links = getSymbolLinks(moduleSymbol);
3073
- if (!dontResolveAlias) {
3074
- links.resolvedExternalModuleSymbol = "circular";
3075
- }
3076
3072
const exportEquals = resolveSymbol(moduleSymbol.exports!.get(InternalSymbolName.ExportEquals), dontResolveAlias);
3077
3073
const exported = getCommonJsExportEquals(getMergedSymbol(exportEquals), getMergedSymbol(moduleSymbol));
3078
- const result = getMergedSymbol(exported) || moduleSymbol;
3079
- if (!dontResolveAlias) {
3080
- // we "cache" this result, but because both the input _and_ the output are mergeable, literally every call could need
3081
- // a different result, assuming the inputs and outputs get merged with. So instead we just use this as a flag that
3082
- // export assignment resolution has occured on this symbol at least once. (because it might happen many times!)
3083
- links.resolvedExternalModuleSymbol = result;
3084
- }
3085
- return result;
3074
+ return getMergedSymbol(exported) || moduleSymbol;
3086
3075
}
3087
3076
return undefined!;
3088
3077
}
@@ -5554,7 +5543,7 @@ namespace ts {
5554
5543
function serializeSymbolWorker(symbol: Symbol, isPrivate: boolean, propertyAsAlias: boolean) {
5555
5544
const symbolName = unescapeLeadingUnderscores(symbol.escapedName);
5556
5545
const isDefault = symbol.escapedName === InternalSymbolName.Default;
5557
- if (( isStringANonContextualKeyword(symbolName) || !isIdentifierText(symbolName, languageVersion)) && !isDefault && symbol.escapedName !== InternalSymbolName.ExportEquals ) {
5546
+ if (isStringANonContextualKeyword(symbolName) && !isDefault) {
5558
5547
// Oh no. We cannot use this symbol's name as it's name... It's likely some jsdoc had an invalid name like `export` or `default` :(
5559
5548
context.encounteredError = true;
5560
5549
// TODO: Issue error via symbol tracker?
@@ -5705,8 +5694,7 @@ namespace ts {
5705
5694
}
5706
5695
5707
5696
function getNamespaceMembersForSerialization(symbol: Symbol) {
5708
- const exports = getExportsOfSymbol(symbol);
5709
- return !exports ? [] : filter(arrayFrom((exports).values()), p => !((p.flags & SymbolFlags.Prototype) || (p.escapedName === "prototype")));
5697
+ return !symbol.exports ? [] : filter(arrayFrom((symbol.exports).values()), p => !((p.flags & SymbolFlags.Prototype) || (p.escapedName === "prototype")));
5710
5698
}
5711
5699
5712
5700
function isTypeOnlyNamespace(symbol: Symbol) {
@@ -8908,17 +8896,6 @@ namespace ts {
8908
8896
function getResolvedMembersOrExportsOfSymbol(symbol: Symbol, resolutionKind: MembersOrExportsResolutionKind): UnderscoreEscapedMap<Symbol> {
8909
8897
const links = getSymbolLinks(symbol);
8910
8898
if (!links[resolutionKind]) {
8911
- // We _must_ resolve any possible commonjs export assignments _before_ merging in late bound members, as cjs export assignments may cause
8912
- // things to be merged (?!?) into this symbol; moreover, we _can't_ resolve those export assignments if we're already resolving the containing
8913
- // module (as then we'll issue a circularity error)
8914
- const p = symbol.valueDeclaration?.parent;
8915
- if (p && isSourceFile(p) && p.symbol && !getSymbolLinks(p.symbol).resolvedExternalModuleSymbol) {
8916
- const exported = resolveExternalModuleSymbol(p.symbol);
8917
- const targetLinks = exported && getSymbolLinks(exported);
8918
- if (targetLinks && targetLinks[resolutionKind]) {
8919
- return links[resolutionKind] = targetLinks[resolutionKind]!;
8920
- }
8921
- }
8922
8899
const isStatic = resolutionKind === MembersOrExportsResolutionKind.resolvedExports;
8923
8900
const earlySymbols = !isStatic ? symbol.members :
8924
8901
symbol.flags & SymbolFlags.Module ? getExportsOfModuleWorker(symbol) :
@@ -35285,8 +35262,8 @@ namespace ts {
35285
35262
}
35286
35263
}
35287
35264
35288
- function createTypeOfDeclaration(declarationIn: AccessorDeclaration | VariableLikeDeclaration | PropertyAccessExpression | ElementAccessExpression | BinaryExpression , enclosingDeclaration: Node, flags: NodeBuilderFlags, tracker: SymbolTracker, addUndefined?: boolean) {
35289
- const declaration = getParseTreeNode(declarationIn, isPossiblyPropertyLikeDeclaration );
35265
+ function createTypeOfDeclaration(declarationIn: AccessorDeclaration | VariableLikeDeclaration | PropertyAccessExpression, enclosingDeclaration: Node, flags: NodeBuilderFlags, tracker: SymbolTracker, addUndefined?: boolean) {
35266
+ const declaration = getParseTreeNode(declarationIn, isVariableLikeOrAccessor );
35290
35267
if (!declaration) {
35291
35268
return createToken(SyntaxKind.AnyKeyword) as KeywordTypeNode;
35292
35269
}
0 commit comments