I'm writing an application where the user enters JavaScript through the eval() function. Is it possible to identify statements and functions that were called as part of that code? For example, how many if statements were included in the user code; how many for loops?
Is there an alternative to eval() or API package (that can be used in-browser as opposed to NPM or linked through CDN) that could be used instead?
I am aware of the security and performance issues around eval() and, at this stage at least, they are not a concern.
Many thanks in advance - Jim