@@ -38,9 +38,9 @@ impl<'a> JSDoc<'a> {
3838mod test {
3939 use oxc_allocator:: Allocator ;
4040 use oxc_parser:: Parser ;
41- use oxc_span:: SourceType ;
41+ use oxc_span:: { SourceType , Span } ;
4242
43- use crate :: { Semantic , SemanticBuilder } ;
43+ use crate :: { Semantic , SemanticBuilder , jsdoc :: parser :: jsdoc_parts :: JSDocCommentPart } ;
4444
4545 fn build_semantic < ' a > ( allocator : & ' a Allocator , source_text : & ' a str ) -> Semantic < ' a > {
4646 let source_type = SourceType :: default ( ) ;
@@ -323,4 +323,25 @@ line2
323323 let tag = tags. next ( ) . unwrap ( ) ;
324324 assert_eq ! ( tag. kind. parsed( ) , "example" ) ;
325325 }
326+
327+ #[ test]
328+ fn parses_issue_11992 ( ) {
329+ let allocator = Allocator :: default ( ) ;
330+ let semantic = build_semantic (
331+ & allocator,
332+ "/**@property [
333+ */" ,
334+ ) ;
335+ let jsdoc = semantic. jsdoc ( ) . iter_all ( ) . next ( ) . unwrap ( ) ;
336+
337+ let mut tags = jsdoc. tags ( ) . iter ( ) ;
338+ assert_eq ! ( tags. len( ) , 1 ) ;
339+
340+ let tag = tags. next ( ) . unwrap ( ) ;
341+ assert_eq ! (
342+ tag. type_name_comment( ) ,
343+ ( None , None , JSDocCommentPart :: new( " [\n " , Span :: new( 12 , 15 ) ) )
344+ ) ;
345+ assert_eq ! ( tag. kind. parsed( ) , "property" ) ;
346+ }
326347}
0 commit comments