Is there any way to do this? Or limit execution time of eval()(e.g. not more then 1 scecond)
1 Answer
You could try one of the minifiers, such as UglifyJS. They all include a parser which might be fairly easy to extract (UglifyJS contains a file called "parse-js.js", although I haven't looked at it in detail).
eval? those should bother you a lot more than the execution time of it.