JavaScript: Alert suppression through single-line /* */ style comments.

This commit is contained in:
Max Schaefer
2020-01-02 10:45:20 +00:00
parent 45d0e5971f
commit 8d1ad5c5f3
5 changed files with 36 additions and 4 deletions

View File

@@ -16,9 +16,11 @@ class SuppressionComment extends Locatable {
SuppressionComment() {
(
text = this.(LineComment).getText() or
text = this.(Comment).getText() or
text = this.(HTML::CommentNode).getText()
) and
// suppression comments must be single-line
not text.matches("%\n%") and
(
// match `lgtm[...]` anywhere in the comment
annotation = text.regexpFind("(?i)\\blgtm\\s*\\[[^\\]]*\\]", _, _)