mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
ignore empty block comments (#1398)
This commit is contained in:
parent
4047aa695d
commit
b38b8db2d0
@ -479,7 +479,7 @@ Visitor.prototype.visit = function(node, filename) {
|
|||||||
* @memberof module:jsdoc/src/parser.Parser
|
* @memberof module:jsdoc/src/parser.Parser
|
||||||
*/
|
*/
|
||||||
function isValidJsdoc(commentSrc) {
|
function isValidJsdoc(commentSrc) {
|
||||||
return commentSrc && commentSrc.indexOf('/**') === 0 &&
|
return commentSrc && commentSrc.length > 4 && commentSrc.indexOf('/**') === 0 &&
|
||||||
commentSrc.indexOf('/***') !== 0;
|
commentSrc.indexOf('/***') !== 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -93,6 +93,27 @@ describe('jsdoc/src/visitor', function() {
|
|||||||
expect(events).toEqual([]);
|
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() {
|
it('should fire an event for JSDoc comments', function() {
|
||||||
var node = {
|
var node = {
|
||||||
leadingComments: [
|
leadingComments: [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user