-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using JSLint <http://jslint.com/> to flight-check our JavaScript. Did some fixing and some hand-waving in the three big JS files: common.js, admin.js and tagui.js. Fixes: - insert semicolons where needed - all ifs, elses, whiles, and fors require blocks - use foo.bar when possible over foo['bar'] - when comparing with 0, null, undefined, and '', use === and !== - use new when constructing from a prototype - use [] instead of new Array(); {} instead of new Object() - supply radix in calls to parseInt - to avoid JS auto-inserted ';', only break lines after punctuation (except in hashes) - where reasonable, define variables and functions before use - when looping with 'for (m in obj)', always filter with hasOwnProperty - do some escaping in regular expressions where parsers may disagree - be more careful about how 'var' and 'function' are used within functions - note that the 'catch' expression is also a declaration - in common.js:function json_update, cleanup involved renaming some variables to make the code read a little plainer Hand-Waving: - added a /*global ... */ comment in common.js to squelch JSLint's complaints about use before definition - wrapped the three valid uses of 'eval' in /*jslint evil: true */, and then false to squelch JSLint's complaints that eval is evil Ignoring: - warnings that the initial ';' is not needed - that we should be careful when making functions within a loop (we know what we're doing) - spurious complaints about '<' in regular expressions (it's a JSLint bug)
- Loading branch information
Showing
3 changed files
with
567 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.