File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,12 @@ module.exports = {
3535 * @constructor
3636 */
3737function DocComment ( value , loc ) {
38+ assert . equal ( typeof value , 'string' , '' ) ;
39+ assert ( typeof loc === 'object' && typeof loc . start === 'object' &&
40+ typeof loc . start . line === 'number' && typeof loc . start . column === 'number' &&
41+ loc . start . line > 0 && loc . start . column >= 0 ,
42+ 'Location object should contains start field with valid line and column numbers' ) ;
43+
3844 // parse comments
3945 var _parsed = _parseComment ( value ) || { } ;
4046
Original file line number Diff line number Diff line change 2222 "node" : " >= 0.10.0"
2323 },
2424 "dependencies" : {
25- "comment-parser" : " ^0.2.2 " ,
25+ "comment-parser" : " zxqfox/comment-parser#jscs-jsdoc " ,
2626 "jsdoctypeparser" : " ^1.1.3"
2727 },
2828 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -7,6 +7,22 @@ describe('jsdoc', function() {
77 var Tag = jsdoc . tag ;
88 var Comment = jsdoc . doc ;
99
10+ describe ( 'inline comment block' , function ( ) {
11+ var c1 ;
12+
13+ before ( function ( ) {
14+ c1 = new Comment ( '/** @tag1 */' , { start : { line : 1 , column : 0 } } ) ;
15+ } ) ;
16+
17+ it ( 'should parses tag' , function ( ) {
18+ expect ( c1 . tags . length ) . to . eq ( 1 ) ;
19+
20+ var tag1 = c1 . tags [ 0 ] ;
21+ expect ( tag1 . id ) . to . eq ( 'tag1' ) ;
22+ } ) ;
23+
24+ } ) ;
25+
1026 describe ( 'location' , function ( ) {
1127
1228 it ( 'should create valid location' , function ( ) {
You can’t perform that action at this time.
0 commit comments