Why does JSHint throw a “possible severe violation” on this line

Trying to test Javascript in JsHint and I get the following:

Possible severe violation:

return ($.event.dispatch || $.event.handle).apply(this, args); 

Any ideas why this is throwing this error?

Thanks guys,

+7
source share
1 answer

JSHint is not sure if the function in which the code is located will be called with the actual this .

To tell JSHint how the function will be called and suppress this warning, add /*jshint validthis: true */ at the beginning of the function.

+14
source

All Articles