Use 'symbolsToArray' to avoid filtering.

This commit is contained in:
Daniel Rosenwasser 2015-03-25 17:36:51 -07:00
parent f70e772acc
commit d1fa506db6
2 changed files with 4 additions and 7 deletions

View File

@ -75,9 +75,7 @@ module ts {
getAliasedSymbol: resolveAlias,
getEmitResolver,
getExportsOfImportDeclaration,
getExportsOfModule(moduleSymbol: Symbol): Symbol[] {
return mapToArray(getExportsOfModule(moduleSymbol));
}
getExportsOfModule: moduleSymbol => symbolsToArray(getExportsOfModule(moduleSymbol)),
};
let unknownSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "unknown");

View File

@ -2535,10 +2535,9 @@ module ts {
if (symbol && symbol.flags & SymbolFlags.HasExports) {
// Extract module or enum members
let exportedMembers = typeInfoResolver.getExportsOfModule(symbol);
forEach(exportedMembers, symbol => {
if (!(symbol.flags & SymbolFlags.ExportStar)
&& typeInfoResolver.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
let exportedSymbols = typeInfoResolver.getExportsOfModule(symbol);
forEach(exportedSymbols, symbol => {
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
symbols.push(symbol);
}
});