File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,12 @@ module.exports = {
35
35
* @constructor
36
36
*/
37
37
function 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
+
38
44
// parse comments
39
45
var _parsed = _parseComment ( value ) || { } ;
40
46
Original file line number Diff line number Diff line change 22
22
"node" : " >= 0.10.0"
23
23
},
24
24
"dependencies" : {
25
- "comment-parser" : " ^0.2.2 " ,
25
+ "comment-parser" : " zxqfox/comment-parser#jscs-jsdoc " ,
26
26
"jsdoctypeparser" : " ^1.1.3"
27
27
},
28
28
"devDependencies" : {
Original file line number Diff line number Diff line change @@ -7,6 +7,22 @@ describe('jsdoc', function() {
7
7
var Tag = jsdoc . tag ;
8
8
var Comment = jsdoc . doc ;
9
9
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
+
10
26
describe ( 'location' , function ( ) {
11
27
12
28
it ( 'should create valid location' , function ( ) {
You can’t perform that action at this time.
0 commit comments