[OpenLayers-Dev] JS Lint complaining about == instead of ===

Tim-Hinnerk Heuer th.heuer at gmail.com
Wed Mar 14 17:49:41 EDT 2012


Hi,

Just wondering: While looking through the code of OpenLayers and saving the
scripts (when my editor automatically runs jslint to check the code for
sanity), I get a lot of warning where you have e.g.:

if (a == null) { // WARNING HERE
    // do something
}
and jslint tells me, it should be
if (a === null) { // NO WARNING HERE
    // do something
}
(which is when the error/warning goes away). I was wondering if we should
put triple === in those places instead. I know it would be a daunting task
to do so but wouldn't it be better to get more consistent results? Because
a == null is true when a =

To be fair it's just annoying getting these warnings when coding. Maybe I
can turn that part of reporting off somehow, because it seems almost
over-sensitive.

Tim

++Tim Hinnerk Heuer++

Twitter: @timhheuer
Blog: http://www.thheuer.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20120315/122aa6c9/attachment.html


More information about the Dev mailing list