]> dev.renevier.net Git - syj.git/blob - scripts/rhino.js
add mapquest layer back
[syj.git] / scripts / rhino.js
1 // rhino.js
2 // 2009-09-11
3 /*
4 Copyright (c) 2002 Douglas Crockford  (www.JSLint.com) Rhino Edition
5 */
6
7 // This is the Rhino companion to fulljslint.js.
8
9 /*global JSLINT */
10 /*jslint rhino: true, strict: false */
11
12 (function (a) {
13     var e, i, input;
14     if (!a[0]) {
15         print("Usage: jslint.js file.js");
16         quit(1);
17     }
18     input = readFile(a[0]);
19     if (!input) {
20         print("jslint: Couldn't open file '" + a[0] + "'.");
21         quit(1);
22     }
23     if (!JSLINT(input, {bitwise: true, eqeqeq: true, immed: true,
24             newcap: true, nomen: true, onevar: false, plusplus: false,
25             regexp: true, rhino: true, undef: false, white: false,
26             'continue': true})) {
27         for (i = 0; i < JSLINT.errors.length; i += 1) {
28             e = JSLINT.errors[i];
29             if (e) {
30                 print('Lint at line ' + e.line + ' character ' +
31                         e.character + ': ' + e.reason);
32                 print((e.evidence || '').
33                         replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
34                 print('');
35             }
36         }
37         quit(2);
38     } else {
39         print("jslint: No problems found in " + a[0]);
40         quit();
41     }
42 }(arguments));