Fork me on GitHub

JSLint Error Explanations

JSLint will hurt your feelings. It's time to make them better!


The Function constructor is a form of eval

When do I get this error?

JSHint (version 1.0.0 and above) will throw the "The Function constructor is a form of eval" error when it encounters a call to the Function constructor function preceded by the new operator. Here's a simple example which defines a function to add two numbers:

This is the JSHint 1.0.0 equivalent of the "The Function constructor is eval" error from JSLint and older versions of JSHint. More detail can be found on the page for that message.

In JSHint 1.0.0 and above you have the ability to ignore any warning with a special option syntax. The identifier of this warning is W054. This means you can tell JSHint to not issue this warning with the /*jshint -W054 */ directive.


comments powered by Disqus