[OpenLayers-Dev] jslint results

Tim Schaub tschaub at openplans.org
Tue Oct 16 13:17:41 EDT 2007


Hey -

Paul Spencer wrote:
> 
> 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.
> 

Thanks for getting a start on this.  Would be good to have this 
integrated into our tests in some manner.  (Not integrated into test 
another way - just as part of the testing procedure.)

> The regular expression one I am not so sure about.  Anyone know  
> anything about javascript syntax in this particular case?
> 

Regarding the regular expression in OpenLayers.js, that condition can 
just be wrapped in parentheses.  More importantly, it should be 
rewritten entirely.  No reason to do regex tests there (string match is 
sufficient), and certainly no reason to do the test in every iteration 
of the loop (yikes).

See the patch for #1092 [1].

Tim

[1] http://trac.openlayers.org/ticket/1092


> 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
> 
> !DSPAM:4033,4714153753634901796417!
> 




More information about the Dev mailing list