mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-25 02:50:59 -05:00
Fixed es2015 imports from export=
(cherry picked from commit 9e46c180b4)
This commit is contained in:
@@ -964,8 +964,16 @@ namespace ts {
|
||||
if (targetSymbol) {
|
||||
const name = specifier.propertyName || specifier.name;
|
||||
if (name.text) {
|
||||
let symbolFromVariable: Symbol;
|
||||
// First check if module was specified with "export=". If so, get the member from the resolved type
|
||||
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) {
|
||||
const members = (getTypeOfSymbol(targetSymbol) as ResolvedType).members;
|
||||
symbolFromVariable = members && members[name.text];
|
||||
}
|
||||
else {
|
||||
symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text);
|
||||
}
|
||||
const symbolFromModule = getExportOfModule(targetSymbol, name.text);
|
||||
const symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text);
|
||||
const symbol = symbolFromModule && symbolFromVariable ?
|
||||
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
|
||||
symbolFromModule || symbolFromVariable;
|
||||
|
||||
Reference in New Issue
Block a user