What steps will reproduce the problem?
1. Run JSLint on dragtable.js
What is the expected output? What do you see instead?
JSLint Errors
Close window
Error:
Problem at line 78 character 9: Avoid arguments.callee.
if (arguments.callee.done) return;
Problem at line 78 character 32: Expected '{' and instead saw 'return'.
if (arguments.callee.done) return;
Problem at line 79 character 5: Avoid arguments.callee.
arguments.callee.done = true;
Problem at line 80 character 19: Expected '{' and instead saw 'clearInterval'.
if (_dgtimer) clearInterval(_dgtimer);
Problem at line 81 character 68: Expected '{' and instead saw 'return'.
if (!document.createElement || !document.getElementsByTagName) return;
Problem at line 94 character 52: Use '===' to compare with '0'.
if (table.getElementsByTagName('thead').length == 0) {
Problem at line 101 character 21: Use '===' to compare with 'null'.
if (table.tHead == null) {
Problem at line 118 character 16: Use the object literal notation {}.
dragObj: new Object(),
Problem at line 124 character 9: Expected '{' and instead saw 'return'.
return elt;
Problem at line 125 character 18: Expected a conditional expression and instead
saw an assignment.
} while (elt = elt.parentNode);
Problem at line 135 character 21: Use '===' to compare with 'null'.
if (value == null) return;
Problem at line 135 character 30: Expected '{' and instead saw 'return'.
if (value == null) return;
Problem at line 136 character 57: Use '===' to compare with '0'.
if (typeof(value) == "string" && value.length == 0) return;
Problem at line 136 character 63: Expected '{' and instead saw 'return'.
if (typeof(value) == "string" && value.length == 0) return;
Problem at line 147 character 9: Bad line breaking before '+'.
+ document.body.scrollLeft;
Problem at line 149 character 9: Bad line breaking before '+'.
+ document.body.scrollTop;
Problem at line 179 character 17: Expected a conditional expression and instead
saw an assignment.
} while (elt = elt.offsetParent);
Problem at line 192 character 7: Expected '{' and instead saw 'dragObj'.
dragObj.origNode = window.event.srcElement;
Problem at line 194 character 7: Expected '{' and instead saw 'dragObj'.
dragObj.origNode = event.target;
Problem at line 206 character 33: Expected '{' and instead saw 'return'.
if (dragObj.startCol == -1) return;
Problem at line 217 character 31: Expected '{' and instead saw 'new_tr'.
if (row.offsetHeight) new_tr.style.height = row.offsetHeight + "px";
Problem at line 219 character 31: Expected '{' and instead saw 'new_td'.
if (cell.offsetWidth) new_td.style.width = cell.offsetWidth + "px";
Problem at line 256 character 37: Expected '{' and instead saw 'dragObj'.
if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
Problem at line 257 character 37: Expected '{' and instead saw 'dragObj'.
if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 0;
Problem at line 360 character 26: Missing semicolon.
row = table.rows[i]
Problem at line 372 character 15: 'i' is already defined.
for (var i=0; i<headrow.length; i++) {
Problem at line 387 character 15: Expected '{' and instead saw 'new_val'.
if (prev) new_val = prev + ",";
Problem at line 394 character 42: Expected '{' and instead saw 'return'.
if (!dragtable.cookiesEnabled()) return;
Problem at line 396 character 23: Expected '{' and instead saw 'return'.
if (!dragstr) return;
Problem at line 400 character 35: Expected '{' and instead saw 'continue'.
if (pair.length != 2) continue;
Problem at line 401 character 21: Missing radix parameter.
var a = parseInt(pair[0]);
Problem at line 402 character 21: Missing radix parameter.
var b = parseInt(pair[1]);
Problem at line 403 character 39: Expected '{' and instead saw 'continue'.
if (isNaN(a) || isNaN(b)) continue;
Problem at line 412 character 4: Duplicate member 'cookiesEnabled'.
},
Problem at line 420 character 10: Expected '{' and instead saw 'var'.
else var expires = "";
Problem at line 420 character 22: 'expires' is already defined.
else var expires = "";
Problem at line 423 character 38: 'expires' used out of scope.
document.cookie = name+"="+value+expires+"; path="+path
Problem at line 423 character 60: Missing semicolon.
document.cookie = name+"="+value+expires+"; path="+path
Problem at line 431 character 32: Expected '{' and instead saw 'c'.
while (c.charAt(0)==' ') c = c.substring(1,c.length);
Problem at line 432 character 29: Use '===' to compare with '0'.
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
Problem at line 432 character 35: Expected '{' and instead saw 'return'.
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
Problem at line 441 character 2: Missing semicolon.
}
Problem at line 468 character 3: Nested comment.
/*@end @*/
Problem at line 468 character 3: Stopping, unable to continue. (86% scanned).
Implied global: dragtable
28,32,38,83,84,87,107,111,113,145,160,162,163,188,190,195,198,203,205,208,213,21
6,218,237,264,265,269,270,279,282,286,296,307,308,309,311,312,316,323,324,329,33
1,332,334,344,385,389,394,395,404,438,454, _dgtimer 80, forEach 85,133,214,230,
the 95,96,97, window 146,148,161,192,266,267,297,298,379,411
Unused variable: el 185 "dragStart", x 185 "dragStart", y 185 "dragStart", x
277 "dragMove", y 277 "dragMove", cA 356 "moveColumn", expires 414
"createCookie"
Original issue reported on code.google.com by tal@lystadonline.no on 21 Nov 2010 at 11:34
Original issue reported on code.google.com by
tal@lystadonline.no
on 21 Nov 2010 at 11:34