isExpandoFunctionDeclaration only checks values (#27052)

Previously it checked types too, which caused a crash because types
don't have valueDeclaration set. But expando functions can't export
types, only values.
This commit is contained in:
Nathan Shively-Sanders
2018-09-12 12:21:50 -07:00
committed by GitHub
parent 6bd1da20c9
commit 2f8a646f8e
5 changed files with 62 additions and 1 deletions

View File

@@ -28154,7 +28154,7 @@ namespace ts {
if (!symbol || !(symbol.flags & SymbolFlags.Function)) {
return false;
}
return !!forEachEntry(getExportsOfSymbol(symbol), p => isPropertyAccessExpression(p.valueDeclaration));
return !!forEachEntry(getExportsOfSymbol(symbol), p => p.flags & SymbolFlags.Value && isPropertyAccessExpression(p.valueDeclaration));
}
function getPropertiesOfContainerFunction(node: Declaration): Symbol[] {