jshint passes - run 'node jshint/run.js'. running jshint with a couple jshint options and workarounds to allow certain jasmine-specific styles. many actual style problems are fixed. the jshint run is integrated into rake jasmine:lint.

This commit is contained in:
Steve Conover
2011-02-26 15:07:59 -08:00
parent 9f90c4eca5
commit f41af6c2d0
20 changed files with 184 additions and 139 deletions

View File

@@ -221,7 +221,7 @@
lightseagreen, lightskyblue, lightslategray, lightsteelblue,
lightyellow, lime, limegreen, line, "line-height", linen, link,
"list-style", "list-style-image", "list-style-position",
"list-style-type", load, loadClass, localStorage, location, log, m, magenta,
"list-style-type", load, loadClass, localStorage, location, log, loopfunc, m, magenta,
map, margin, "margin-bottom", "margin-left", "margin-right", "margin-top",
mark, "marker-offset", maroon, match, "max-height", "max-width", maxerr,
maxlen, md5, mediumaquamarine, mediumblue, mediumorchid, mediumpurple,
@@ -314,9 +314,9 @@ var JSHINT = (function () {
},
// These are the JSHint options.
// These are the JSHint boolean options.
options = {
boolOptions = {
adsafe : true, // if ADsafe should be enforced
asi : true, // if automatic semicolon insertion should be tolerated
bitwise : true, // if bitwise operators should not be allowed
@@ -336,6 +336,7 @@ var JSHINT = (function () {
immed : true, // if immediate invocations must be wrapped in parens
jquery : true, // if jQuery globals should be predefined
laxbreak : true, // if line breaks should not be checked
loopfunc : true, // if functions should be allowed to be defined within loops
newcap : true, // if constructor names must be capitalized
noarg : true, // if arguments.caller and arguments.callee should be disallowed
node : true, // if the Node.js environment globals should be predefined
@@ -356,7 +357,7 @@ var JSHINT = (function () {
white : true, // if strict whitespace rules apply
widget : true // if the Yahoo Widgets globals should be predefined
},
// browser contains a set of global names which are commonly provided by a
// web browser environment.
@@ -2017,7 +2018,7 @@ klass: do {
warning("ADsafe restriction.");
}
obj = option;
filter = options;
filter = boolOptions;
break;
case '/*global':
if (option.safe) {
@@ -4896,7 +4897,7 @@ loop: for (;;) {
t = nexttoken;
adjacent(token, nexttoken);
f = doFunction(i);
if (funct['(loopage)']) {
if (!option.loopfunc && funct['(loopage)']) {
warning("Don't make functions within a loop.", t);
}
p = f['(params)'];
@@ -5032,7 +5033,7 @@ loop: for (;;) {
nonadjacent(token, nexttoken);
}
doFunction(i);
if (funct['(loopage)']) {
if (!option.loopfunc && funct['(loopage)']) {
warning("Don't make functions within a loop.");
}
return this;
@@ -5529,11 +5530,10 @@ loop: for (;;) {
// The actual JSHINT function itself.
var itself = function (s, o, g) {
var itself = function (s, o) {
var a, i, k;
JSHINT.errors = [];
predefined = Object.create(standard);
combine(predefined, g || {});
if (o) {
a = o.predef;
if (a) {
@@ -5552,22 +5552,23 @@ loop: for (;;) {
o.safe = true;
}
if (o.safe) {
o.browser =
o.css =
o.debug =
o.devel =
o.evil =
o.forin =
o.on =
o.rhino =
o.windows =
o.sub =
o.widget = false;
o.browser =
o.css =
o.debug =
o.devel =
o.evil =
o.forin =
o.loopfunc =
o.on =
o.rhino =
o.windows =
o.sub =
o.widget = false;
o.eqeqeq =
o.nomen =
o.safe =
o.undef = true;
o.eqeqeq =
o.nomen =
o.safe =
o.undef = true;
predefined.Date =
predefined['eval'] =