Merge pull request #14876 from JoshuaKGoldberg/patch-1

symbolDisplay comment fix: "experts" vs "exports"
This commit is contained in:
Mohamed Hegazy 2017-03-27 09:47:37 -07:00 committed by GitHub
commit c949116fa9

View file

@ -419,7 +419,7 @@ namespace ts.SymbolDisplay {
if (!documentation) {
documentation = symbol.getDocumentationComment();
if (documentation.length === 0 && symbol.flags & SymbolFlags.Property) {
// For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo`
// For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo`
// there documentation comments might be attached to the right hand side symbol of their declarations.
// The pattern of such special property access is that the parent symbol is the symbol of the file.
if (symbol.parent && forEach(symbol.parent.declarations, declaration => declaration.kind === SyntaxKind.SourceFile)) {