File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -5090,9 +5090,6 @@ namespace ts {
5090
5090
if (!isInJavaScriptFile(decl)) {
5091
5091
return undefined;
5092
5092
}
5093
- else if (isJSDocPropertyLikeTag(decl) && decl.typeExpression) {
5094
- return getTypeFromTypeNode(decl.typeExpression.type);
5095
- }
5096
5093
// Handle certain special assignment kinds, which happen to union across multiple declarations:
5097
5094
// * module.exports = expr
5098
5095
// * exports.p = expr
Original file line number Diff line number Diff line change @@ -3358,7 +3358,9 @@ namespace ts {
3358
3358
* parsed in a JavaScript file, gets the type annotation from JSDoc.
3359
3359
*/
3360
3360
export function getEffectiveTypeAnnotationNode ( node : Node ) : TypeNode | undefined {
3361
- return ( node as HasType ) . type || ( isInJavaScriptFile ( node ) ? getJSDocType ( node ) : undefined ) ;
3361
+ const type = ( node as HasType ) . type ;
3362
+ if ( type || ! isInJavaScriptFile ( node ) ) return type ;
3363
+ return isJSDocPropertyLikeTag ( node ) ? node . typeExpression && node . typeExpression . type : getJSDocType ( node ) ;
3362
3364
}
3363
3365
3364
3366
export function getTypeAnnotationNode ( node : Node ) : TypeNode | undefined {
You can’t perform that action at this time.
0 commit comments