mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
don't crash if a file does not contain any comments (#368)
This commit is contained in:
parent
ef4ba57adb
commit
f0224e9845
@ -10,6 +10,8 @@ exports.handlers = {
|
||||
beforeParse: function(e) {
|
||||
// a JSDoc comment looks like: /**[one or more chars]*/
|
||||
var comments = e.source.match(/\/\*\*[\s\S]+?\*\//g);
|
||||
e.source = comments.join('\n\n');
|
||||
if (comments) {
|
||||
e.source = comments.join('\n\n');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user