[dojo-contributors] No Side Effects Rejection

Mike Wilcox mwilcox at sitepen.com
Mon May 11 10:51:07 EDT 2009


>>
> "code has no side effects" is a lint warning for:
>
> foo && foo.bar && foo.bar()
>
> the "longhand, jslint-approved way" of writing that would be
>
> if(foo && foo.bar){
>    foo.bar();
> }

I'm not doing that. And BTW, since we can't use getters and setters,  
your first case should be allowed.


In embed.Flash it chokes on a try catch (line 333). Admittedly, it's  
inside of a double time out and some hitches, but that's my point - it  
doesn't work.

In FileUploader, it rejects my commit on this line:

if (this._formNode) { return };

My first case if really complex, but the second one has nothing  
complex in it at all. This feature is broken, and is probably keeping  
me from seeing more important (or legitimate) validations.

>
> Perhaps the existing jslint settings are too strict, but that is not  
> the
> discussion at hand.

So I started a new one :)

This is important. It's valid code and it gets rejected.

Mike



More information about the dojo-contributors mailing list