jshint/jshint — pull request #514 by TheJosh (2012-04-14 00:27:39+00:00)
Title: Checking of strings within eval(), setTimeout(), etc

Hi,

There are cases (especially with setTimeout) where the eval-style code contains a static string. I know that eval (and friends) is evil, but I had an incident recently where some code written by an incompetent colleague was causing errors, and it was hard to track down because JSHint didn't see the error.

Anyway, these patches add support for syntax checking eval (and friends) when they contain a string-only argument.

It works by putting those strings into a list, and running through them afterwards. I initially tried using recursive function calls, but it was messing with the globals (.errors) and the internal parser state.

The unit tests might need some more work still - the .errors now contain a "scope" parameter, but the unit tests don't check it.

I know we are currently in feature freeze, so this is more of a request-for-comments.

Cheers,
Josh