Merge pull request #928 from acbabis/patch-1

Make the commentsOnly plugin work correctly when a file contains no comments (#928)
This commit is contained in:
Jeff Williams 2015-03-01 18:01:48 -08:00
commit 46cbd5c452

View File

@ -13,6 +13,8 @@ exports.handlers = {
var comments = e.source.match(/\/\*\*[\s\S]+?\*\//g);
if (comments) {
e.source = comments.join('\n\n');
} else {
e.source = ''; // If file has no comments, parser should still receive no code
}
}
};