All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.Eval.html Maven / Gradle / Ivy

There is a newer version: 2.5
Show newest version

The eval() function in JavaScript is a way to run arbitrary code at run-time. In almost all cases, eval should never be used. If it exists in your page, there is almost always a more correct way to accomplish what you are doing. The rule is, "Eval is evil." Don't use it unless you are an experienced developer and know that your case is an exception.

The following code snippet illustrates this rule :

var myCode = 'alert("Howdy?");';
eval(myCode);     // Non-Compliant




© 2015 - 2024 Weber Informatics LLC | Privacy Policy