Add some tests for comment-filters through api

Also never bother comment options to filter comment5/shebang comments
as they have their custom filter.
This commit is contained in:
Anthony Van de Gejuchte
2016-01-19 14:00:22 +01:00
committed by Richard van Velzen
parent 57e0fafd5c
commit 70e5b6f15b
2 changed files with 47 additions and 2 deletions

View File

@@ -444,11 +444,11 @@ function OutputStream(options) {
});
} else if (c.test) {
comments = comments.filter(function(comment){
return c.test(comment.value) || comment.type == "comment5";
return comment.type == "comment5" || c.test(comment.value);
});
} else if (typeof c == "function") {
comments = comments.filter(function(comment){
return c(self, comment) || comment.type == "comment5";
return comment.type == "comment5" || c(self, comment);
});
}