File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6693,10 +6693,15 @@ namespace ts {
66936693 typedefTag . fullName = parseJSDocTypeNameWithNamespace ( /*flags*/ 0 ) ;
66946694 if ( typedefTag . fullName ) {
66956695 let rightNode = typedefTag . fullName ;
6696- while ( rightNode . kind !== SyntaxKind . Identifier ) {
6696+ while ( true ) {
6697+ if ( rightNode . kind === SyntaxKind . Identifier || ! rightNode . body ) {
6698+ // if node is identifier - use it as name
6699+ // otherwise use name of the rightmost part that we were able to parse
6700+ typedefTag . name = rightNode . kind === SyntaxKind . Identifier ? rightNode : rightNode . name ;
6701+ break ;
6702+ }
66976703 rightNode = rightNode . body ;
66986704 }
6699- typedefTag . name = rightNode ;
67006705 }
67016706 typedefTag . typeExpression = typeExpression ;
67026707 skipWhitespace ( ) ;
Original file line number Diff line number Diff line change 1+ === tests/cases/compiler/a.js ===
2+
3+ No type information for this code./** @typedef {{ endTime: number, screenshots: number}} A.<b>*/
4+ No type information for this code.Animation.AnimationModel.ScreenshotCapture.Request;
5+ No type information for this code.
6+ No type information for this code./** @typedef {{ endTime: number, screenshots: !B.<string>}} */
7+ No type information for this code.Animation.AnimationModel.ScreenshotCapture.Request;
8+ No type information for this code.
Original file line number Diff line number Diff line change 1+ === tests/cases/compiler/a.js ===
2+
3+ /** @typedef {{ endTime: number, screenshots: number}} A.<b>*/
4+ Animation.AnimationModel.ScreenshotCapture.Request;
5+ >Animation.AnimationModel.ScreenshotCapture.Request : any
6+ >Animation.AnimationModel.ScreenshotCapture : any
7+ >Animation.AnimationModel : any
8+ >Animation : any
9+ >AnimationModel : any
10+ >ScreenshotCapture : any
11+ >Request : any
12+
13+ /** @typedef {{ endTime: number, screenshots: !B.<string>}} */
14+ Animation.AnimationModel.ScreenshotCapture.Request;
15+ >Animation.AnimationModel.ScreenshotCapture.Request : any
16+ >Animation.AnimationModel.ScreenshotCapture : any
17+ >Animation.AnimationModel : any
18+ >Animation : any
19+ >AnimationModel : any
20+ >ScreenshotCapture : any
21+ >Request : any
22+
Original file line number Diff line number Diff line change 1+ // @allowJs : true
2+ // @noEmit : true
3+
4+ // @filename : a.js
5+ /** @typedef {{ endTime: number, screenshots: number} } A.<b>*/
6+ Animation . AnimationModel . ScreenshotCapture . Request ;
7+
8+ /** @typedef {{ endTime: number, screenshots: !B.<string>} } */
9+ Animation . AnimationModel . ScreenshotCapture . Request ;
You can’t perform that action at this time.
0 commit comments