mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 02:15:10 -05:00
Fix #8507: Consider UnknownSymbols values for import/export purposes
This commit is contained in:
@@ -1133,9 +1133,8 @@ namespace ts {
|
||||
const symbol = getSymbolOfNode(node);
|
||||
const target = resolveAlias(symbol);
|
||||
if (target) {
|
||||
const markAlias =
|
||||
(target === unknownSymbol && compilerOptions.isolatedModules) ||
|
||||
(target !== unknownSymbol && (target.flags & SymbolFlags.Value) && !isConstEnumOrConstEnumOnlyModule(target));
|
||||
const markAlias = target === unknownSymbol ||
|
||||
((target.flags & SymbolFlags.Value) && !isConstEnumOrConstEnumOnlyModule(target));
|
||||
|
||||
if (markAlias) {
|
||||
markAliasSymbolAsReferenced(symbol);
|
||||
@@ -16983,14 +16982,12 @@ namespace ts {
|
||||
|
||||
function isAliasResolvedToValue(symbol: Symbol): boolean {
|
||||
const target = resolveAlias(symbol);
|
||||
if (target === unknownSymbol && compilerOptions.isolatedModules) {
|
||||
if (target === unknownSymbol) {
|
||||
return true;
|
||||
}
|
||||
// const enums and modules that contain only const enums are not considered values from the emit perspective
|
||||
// unless 'preserveConstEnums' option is set to true
|
||||
return target !== unknownSymbol &&
|
||||
target &&
|
||||
target.flags & SymbolFlags.Value &&
|
||||
return target.flags & SymbolFlags.Value &&
|
||||
(compilerOptions.preserveConstEnums || !isConstEnumOrConstEnumOnlyModule(target));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user