diff --git a/lib/jsdoc/src/visitor.js b/lib/jsdoc/src/visitor.js index d8dbd8ac..1d5f409b 100644 --- a/lib/jsdoc/src/visitor.js +++ b/lib/jsdoc/src/visitor.js @@ -479,7 +479,7 @@ Visitor.prototype.visit = function(node, filename) { * @memberof module:jsdoc/src/parser.Parser */ function isValidJsdoc(commentSrc) { - return commentSrc && commentSrc.indexOf('/**') === 0 && + return commentSrc && commentSrc.length > 4 && commentSrc.indexOf('/**') === 0 && commentSrc.indexOf('/***') !== 0; } diff --git a/test/specs/jsdoc/src/visitor.js b/test/specs/jsdoc/src/visitor.js index 334ed5f3..8e95710e 100644 --- a/test/specs/jsdoc/src/visitor.js +++ b/test/specs/jsdoc/src/visitor.js @@ -93,6 +93,27 @@ describe('jsdoc/src/visitor', function() { expect(events).toEqual([]); }); + it('should ignore empty block comments', function() { + var node = { + leadingComments: [ + { + type: 'CommentBlock', + value: '', + loc: { + start: { + line: 0, + column: 0 + } + } + } + ] + }; + + visitor.visitNodeComments(node, parser, 'fake'); + + expect(events).toEqual([]); + }); + it('should fire an event for JSDoc comments', function() { var node = { leadingComments: [