I wanted to know if it is possible to find through javascript if a call to eval() has a syntax error or undefined variable, etc... so lets say I use eval for some arbitrary
To continue using the code after validation, I use the following example:
var validCode = 1; try { eval( jsCode ); /* Code test */ } catch (e) { if (e instanceof SyntaxError) { validCode = 0; console.warn(e.message); } } finally { if(validCode){ "do some magic" } }