[OpenLayers-Dev] jslint results

Erik Uzureau erik.uzureau at metacarta.com
Tue Oct 16 13:57:32 EDT 2007


On 10/15/07, Paul Spencer <pspencer at dmsolutions.ca> wrote:
> Hi devs,
>
> I finally got around to hacking my jslint support to run across all
> files in a directory structure rather than just a single file and got
> these results on trunk:
>
> Warnings about missing semi-colons:
>
> firebug.js: 3 warnings
> firebugx.js: 1 warning
> Ajax.js: 5 warnings
> Class.js: 5 warnings
> EditingToolbar.js: 1 warning
> LayerSwitcher.js: 1 warning
> MouseDefaults.js: 1 warning
> MouseToolbar.js: 1 warning
> PanZoomBar.js: 4 warnings
> Events.js: 1 warning
> Vector.js: 1 warning
> WFS.js: 1 warning
> GeoJSON.js: 4 warnings
> WKT.js: 1 warning
> Polygon.js: 1 warning
> Drag.js: 3 warnings
> EventPane.js: 2 warnings
> Google.js: 2 warnings
> MultiMap.js: 2 warnings
> VirtualEarth: 2 warnings
> Yahoo.js: 2 warnings
> Layer.js: 1 warning
> VML.js: 2 warnings
> Image.js: 1 warning
> Util.js: 6 warnings
> Rico/Color.js: 4 warnings
> Rico/Corner.js: 3 warnings
> tests/throws.js: 1 warning
>
> OpenLayers.js: 1 warning  regular expressions should be preceded by a
> left parenthesis, assignment, colon, or comma
>              if (/MSIE/.test(navigator.userAgent) || /Safari/.test
> (navigator.userAgent)) {
>
> The semi-colon warnings are all trivial and browsers work around them
> no problem.  The only issue can be in compression and I think the
> compression engine used is smart enough to add a semi-colon where it
> needs one. However, it would probably be a good idea to fix these
> warnings anyway.  My little tool contains hyperlinks back to the file/
> line with the problem so it is trivial albeit time consuming for me
> to fix them if everyone agrees.

As a core committer, you should feel free to make these changes as you
see fit. OpenLayers has a (somewhat unstated) policy that
non-functional patches need not go through the standard
ticket/approval system.

...which means that if you want to replace a missing semicolon or tab
out a line or add a comment or something like that, you should just go
ahead and do it. As long as it doesn't change the functioning of the
code.

Erik

ps. thanks so much for taking the time to run this analysis. Looks
like our code has not a few little oversights!


> The regular expression one I am not so sure about.  Anyone know
> anything about javascript syntax in this particular case?
>
> Cheers
>
> Paul
>
>
> +-----------------------------------------------------------------+
> |Paul Spencer                          pspencer at dmsolutions.ca    |
> +-----------------------------------------------------------------+
> |Chief Technology Officer                                         |
> |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
> +-----------------------------------------------------------------+
>
>
>
>
>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list