Given this JavaScript code (which is just a comment referring to a url):
// see http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/
JSLint with "Safe Subset" turned on will say
Dangerous comment.
// http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/
How can a comment be dangerous? Comments, by definition, aren't parsed! Or are they?
Edit: Using a different url isn't necessarily dangerous. For example this:
// http://enterprisejquery.com
doesn't trigger the flag. How can one URL in a comment be 'dangerous', but another isn't?
"Dangerous" comments match the regular expression:
/@cc|<\/?|script|\]\s*\]|<\s*!|</i
In this case, your comment is "dangerous" because it contains the string "script".
I think this is probably a false positive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With