@@ -6334,19 +6334,18 @@ namespace ts {
6334
6334
Debug . assert ( start <= end ) ;
6335
6335
Debug . assert ( end <= content . length ) ;
6336
6336
6337
+ // Check for /** (JSDoc opening part)
6338
+ if ( ! isJSDocLikeText ( content , start ) ) {
6339
+ return undefined ;
6340
+ }
6341
+
6337
6342
let tags : JSDocTag [ ] ;
6338
6343
let tagsPos : number ;
6339
6344
let tagsEnd : number ;
6340
6345
const comments : string [ ] = [ ] ;
6341
- let result : JSDoc | undefined ;
6342
-
6343
- // Check for /** (JSDoc opening part)
6344
- if ( ! isJSDocLikeText ( content , start ) ) {
6345
- return result ;
6346
- }
6347
6346
6348
6347
// + 3 for leading /**, - 5 in total for /** */
6349
- scanner . scanRange ( start + 3 , length - 5 , ( ) => {
6348
+ return scanner . scanRange ( start + 3 , length - 5 , ( ) => {
6350
6349
// Initially we can parse out a tag. We also have seen a starting asterisk.
6351
6350
// This is so that /** * @type */ doesn't parse.
6352
6351
let state = JSDocState . SawAsterisk ;
@@ -6432,11 +6431,9 @@ namespace ts {
6432
6431
}
6433
6432
removeLeadingNewlines ( comments ) ;
6434
6433
removeTrailingNewlines ( comments ) ;
6435
- result = createJSDocComment ( ) ;
6434
+ return createJSDocComment ( ) ;
6436
6435
} ) ;
6437
6436
6438
- return result ;
6439
-
6440
6437
function removeLeadingNewlines ( comments : string [ ] ) {
6441
6438
while ( comments . length && ( comments [ 0 ] === "\n" || comments [ 0 ] === "\r" ) ) {
6442
6439
comments . shift ( ) ;
0 commit comments