mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 19:27:35 -06:00
Handle JSDoc tags on 'this' properties
This commit is contained in:
parent
cbc112a761
commit
c8cd748e48
@ -2937,6 +2937,14 @@ namespace ts {
|
||||
}
|
||||
// Handle module.exports = expr
|
||||
if (declaration.kind === SyntaxKind.BinaryExpression) {
|
||||
// Use JS Doc type if present on parent expression statement
|
||||
if (declaration.flags & NodeFlags.JavaScriptFile) {
|
||||
const typeTag = getJSDocTypeTag(declaration.parent);
|
||||
if (typeTag && typeTag.typeExpression) {
|
||||
return links.type = getTypeFromTypeNode(typeTag.typeExpression.type);
|
||||
}
|
||||
}
|
||||
|
||||
return links.type = getUnionType(map(symbol.declarations, (decl: BinaryExpression) => checkExpressionCached(decl.right)));
|
||||
}
|
||||
if (declaration.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user