The situation is:
User writes some js-code and it should be runned on some data (locally).
But sometimes there are endless loops or recursive calls… That's why I need to limit the execution time of a function but not to edit the function itself (and even if so — should I insert checks after every sequence point? but what about recursive calls?)
Are there any other solutions for this strange problem? Maybe eval can give some parse tree of the code or something like that?