jscritic icon indicating copy to clipboard operation
jscritic copied to clipboard

Using an string parameter with `setTimeout` and `setInterval` is also a form of eval

Open chris-l opened this issue 10 years ago • 0 comments

Just like with new Function, this is also a form of eval.

After checking your a8288bc commit, you only need to add to that line || e.code === 'W066'.

W066 is the code for a "Implied eval" (the kind of eval done by setTimeout and setInterval).

Check the code on the jshint source here: https://github.com/jshint/jshint/blob/2.1.4/src/shared/messages.js#L137

chris-l avatar Apr 06 '14 19:04 chris-l