JSLint Reports on last 2 Production Versions of jQuery

L

lorlarz

Results of jQuery new production version and last production version
on JSLint
( http://www.jslint.com/ )

1.4.2 ,new jQuery production version (compared to the last 'production
version', 1.3.2).
The new one seems to have about
20% more errors _and_, more importantly, seems (to me) to have more
serious errors.

**I need more opinions.**


I have a zip on my web site containing:

jQuery 1.4.2 all on one line, comments left out
jQuery 1.3.2 all on one line, comments left out
The JSLint report on each (clearly labeled).

This zip is at: http://mynichecomputing.org/JSLintCompare.zip .
Download it an unzip and
take a look.

Frankly, I used to be unconcerned about the JSLint errors in 1.3.2
_but_ really do most certainly
_not_ know whether it would be reasonable to be not concerned about
some of the errors shown
by 1.4.2 .

Is it as bad as it looks? Is the credibility of the newest jQuery core
production release
on the line? Or, at least in part, should the credibility of JSLint be
wondered about?

John Resigs position: (quoting directly):
"Doesn't worry me at all - we don't follow JSLint and it's obsessively
strict style guidelines"
 
D

David Mark

lorlarz said:
Results of jQuery new production version and last production version
on JSLint
( http://www.jslint.com/ )

1.4.2 ,new jQuery production version (compared to the last 'production
version', 1.3.2).

How can you release a production version of a script for Websites once a
month? I can't understand how people can see that as sane.
The new one seems to have about
20% more errors _and_, more importantly, seems (to me) to have more
serious errors.

They've never been close on that. They really need to worry about their
bogus _logic_ before the style. In contrast, the full build of My
Library has 6 or 7 flagged lines in roughly 10,000 (and two of them are
Function constructor is eval). :)

**I need more opinions.**


I have a zip on my web site containing:

jQuery 1.4.2 all on one line, comments left out
jQuery 1.3.2 all on one line, comments left out

Don't bother running the minified versions through. That won't be
productive. Use the full versions.
The JSLint report on each (clearly labeled).

This zip is at: http://mynichecomputing.org/JSLintCompare.zip .
Download it an unzip and
take a look.

Frankly, I used to be unconcerned about the JSLint errors in 1.3.2
_but_ really do most certainly
_not_ know whether it would be reasonable to be not concerned about
some of the errors shown
by 1.4.2 .

It indicates sloppiness and makes it impossible for them to use such a
tool to catch obvious mistakes like typos (which is a definite concern).
When I was rewriting Dojo, I ran every file through JSLint and found
(and fixed) lots of typos, undeclared variables, etc. It's funny,
because a few months later, there was a movement to un-declare _all_ of
their globals as somebody had posted some meaningless numbers that
seemed to indicate to them that Dojo would run _faster_ that way. They
have a lint that runs on check-ins, but they all bypass it every time
with a !strict directive. :(
Is it as bad as it looks? Is the credibility of the newest jQuery core
production release
on the line?

They never _had_ any credibility. And, as documented to death, their
logic is largely bunk, so it would hardly matter if it were packaged as
stylish code.
Or, at least in part, should the credibility of JSLint be
wondered about?

No, JSLint may be overbearing (but is configurable of course), but it is
quite credible.
John Resigs position: (quoting directly):
"Doesn't worry me at all - we don't follow JSLint and it's obsessively
strict style guidelines"

They don't follow anything but delusions. And I've noticed a
correlation between bad coders and the misuse of its/it's. There seems
to be a pattern there, but the data is not conclusive (kind of like the
implied global/fast code theory).

Try their raw version and see how that does. I predict it will be
better, but still won't come close to finishing the verification process.
 
L

lorlarz

lorlarz said:
Results of jQuery new production version and last production version
[snip]
Don't bother running the minified versions through.  That won't be
productive.  Use the full versions.
The JSLint report on each (clearly labeled).
This zip is at:http://mynichecomputing.org/JSLintCompare.zip.
Download it an unzip and
take a look.
Frankly, I used to be unconcerned about the JSLint errors in 1.3.2
_but_ really do most certainly
_not_ know whether it would be reasonable to be not concerned about
some of the errors shown
by 1.4.2 .

It indicates sloppiness and makes it impossible for them to use such a
tool to catch obvious mistakes like typos (which is a definite concern).
 When I was rewriting Dojo, I ran every file through JSLint and found
(and fixed) lots of typos, undeclared variables, etc.  It's funny,
because a few months later, there was a movement to un-declare _all_ of
their globals as somebody had posted some meaningless numbers that
seemed to indicate to them that Dojo would run _faster_ that way.  They
have a lint that runs on check-ins, but they all bypass it every time
with a !strict directive.  :(


Is it as bad as it looks? Is the credibility of the newest jQuery core
production release
on the line?

They never _had_ any credibility.  And, as documented to death, their
logic is largely bunk, so it would hardly matter if it were packaged as
stylish code.
Or, at least in part, should the credibility of JSLint be
wondered about?

No, JSLint may be overbearing (but is configurable of course), but it is
quite credible.


John Resigs position: (quoting directly):
"Doesn't worry me at all - we don't follow JSLint and it's obsessively
strict style guidelines"

They don't follow anything but delusions.  And I've noticed a
correlation between bad coders and the misuse of its/it's.  There seems
to be a pattern there, but the data is not conclusive (kind of like the
implied global/fast code theory).

Try their raw version and see how that does.  I predict it will be
better, but still won't come close to finishing the verification process.

When I send the non-minimized version through, only 41% gers scanned,
though
the 'errors' do look a lot more benign. I wish I could get the whole
thing
through.

I have noticed a trend to. It's not certain but many JS programmers
seem to
be meaner than junk yard dog, whether they/it know their/its butt from
a hole
in the ground or not.
 
R

rf

lorlarz wrote:
I have noticed a trend to. It's not certain but many JS programmers
seem to
be meaner than junk yard dog, whether they/it know their/its butt from
a hole
in the ground or not.

Good luck getting your next question answered.
 
L

lorlarz

lorlarz said:
Results of jQuery new production version and last production version
on JSLint
(http://www.jslint.com/)
[snip]



Don't bother running the minified versions through.  That won't be
productive.  Use the full versions.

I commented out a couple of regular expression things JSLint could not
stand and
made what I saw as about a half dozen corrections AND was able to run
all the
non-minimized _WITH_ COMMENTS REMOVED jQuery 1.4.2 through JSLint and
get
a full report. Looks quite benigh (though there were the half dozen
errors and
a couple or regular expressions commented out). Here is the report
AFTER those
changes: Most, _though NOT all_ of the report, look benign AFTER all
that:

Error:
Problem at line 1 character 20: Expected an identifier and instead saw
'undefined' (a reserved word).

(function( window, undefined ) {

Problem at line 13 character 48: Unescaped '-'.

quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,

Problem at line 33 character 20: 'hasOwnProperty' is a really bad
name.

hasOwnProperty = Object.prototype.hasOwnProperty,

Problem at line 145 character 20: Use '===' to compare with 'null'.

return num == null ?

Problem at line 261 character 41: Use '!==' to compare with 'null'.

if ( (options = arguments[ i ]) != null ) {

Problem at line 356 character 48: Use '===' to compare with 'null'.

toplevel = window.frameElement == null;

Problem at line 488 character 20: Use '!==' to compare with 'null'.

if ( array != null ) {

Problem at line 489 character 31: Use '===' to compare with 'null'.

if ( array.length == null || typeof array === "string" ||
jQuery.isFunctio...

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 550 character 24: Use '!==' to compare with 'null'.

if ( value != null ) {

Problem at line 593 character 4: Mixed spaces and tabs.

[];

Problem at line 689 character 21: Missing '()' invoking a constructor.

return (new Date).getTime();

Problem at line 753 character 13: 'e' is already defined.

} catch(e) {

Problem at line 1270 character 28: Expected an assignment or function
call and instead saw an expression.

parent.selectedIndex;

Problem at line 1273 character 43: Expected an assignment or function
call and instead saw an expression.

parent.parentNode.selectedIndex;

Problem at line 1362 character 55: 'eventHandle' is already defined.

eventHandle = elemData.handle, eventHandle;

Problem at line 1471 character 106: Missing semicolon.

jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\
\.)?")...

Problem at line 1495 character 25: 'j' is already defined.

for ( var j = pos || 0; j < eventType.length; j++ ) {

Problem at line 1500 character 34: Use '===' to compare with 'null'.

if ( pos == null ) {

Problem at line 1509 character 30: Use '!==' to compare with 'null'.

if ( pos != null ) {

Problem at line 1515 character 48: Use '!==' to compare with 'null'.

if ( eventType.length === 0 || pos != null && eventType.length === 1 )
{

Problem at line 1619 character 26: 'e' is already defined.

} catch (e) {}

Problem at line 1633 character 30: Bad assignment.

event = arguments[0] = jQuery.event.fix( event || window.event );

Problem at line 1644 character 20: 'events' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1644 character 60: 'handlers' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1704 character 26: Use '===' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1704 character 51: Use '!==' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1955 character 19: Use '!==' to compare with 'null'.

if ( data != null || val ) {

Problem at line 2154 character 39: Use '!==' to compare with 'null'.

while ( (type = types[ i++ ]) != null ) {

Problem at line 2182 character 18: Don't make functions within a loop.

});

Problem at line 2190 character 6: Missing semicolon.

}

Problem at line 2283 character 56: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2283 character 81: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2347 character 21: 'ret' is already defined.

var ret = seed ?

Problem at line 2367 character 26: Use '===' to compare with 'null'.

if ( pop == null ) {

Problem at line 2383 character 23: 'cur' used out of scope.

Sizzle.error( cur || selector );

Problem at line 2390 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 25: 'i' is already defined.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2443 character 40: 'match' is already defined.

var type = Expr.order, match;

Problem at line 2452 character 26: Use '!==' to compare with 'null'.

if ( set != null ) {

Problem at line 2473 character 64: Use '!==' to compare with 'null'.

if ( (match = Expr.leftMatch[ type ].exec( expr )) != null &&
match[2] ) {

Problem at line 2498 character 58: Use '!==' to compare with 'null'.

for ( var i = 0; (item = curLoop) != null; i++ ) {

Problem at line 2503 character 51: Use '!==' to compare with 'null'.

if ( inplace && found != null ) {

Problem at line 2534 character 27: Use '===' to compare with 'null'.

if ( anyFound == null ) {

Problem at line 2554 character 35: Unescaped '-'.

ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2555 character 39: Unescaped '-'.

CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2556 character 48: Unescaped '-'.

NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,

Problem at line 2557 character 41: Unescaped '-'.

ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)
\3|)\s*...

Problem at line 2558 character 38: Unescaped '-'.

TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,

Problem at line 2559 character 65: Unescaped '-'.

CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,

Problem at line 2560 character 69: Unescaped '-'.

POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,

Problem at line 2561 character 39: Unescaped '-'.

PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\
(\)]*)...

Problem at line 2611 character 29: 'i' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2611 character 36: 'l' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2612 character 30: 'elem' is already defined.

var elem = checkSet;

Problem at line 2633 character 61: 'nodeCheck' used out of scope.

checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);

Problem at line 2643 character 66: 'nodeCheck' used out of scope.

checkFn("previousSibling", part, doneName, checkSet, nodeCheck,
isXML);

Problem at line 2678 character 56: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = curLoop) != null; i++ ) {

Problem at line 2758 character 29: Expected an assignment or function
call and instead saw an expression.

elem.parentNode.selectedIndex;

Problem at line 2771 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /h\d/i.test( elem.nodeName );

Problem at line 2801 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /input|select|textarea|button/i.test(elem.nodeName);

Problem at line 2841 character 29: 'i' is already defined.

for ( var i = 0, l = not.length; i < l; i++ ) {

Problem at line 2865 character 32: Expected a 'break' statement before
'case'.

node = elem;

Problem at line 2915 character 34: Use '!==' to compare with 'null'.

elem[ name ] != null ?

Problem at line 2922 character 27: Use '===' to compare with 'null'.

return result == null ?

Problem at line 2958 character 6: Don't make functions within a loop.

}));

Problem at line 2973 character 77: Expected an assignment or function
call and instead saw an expression.

Array.prototype.slice.call( document.documentElement.childNodes, 0 )
[0].node...

Problem at line 2987 character 29: 'i' is already defined.

for ( var i = 0; array; i++ ) {

Problem at line 3070 character 34: Missing '()' invoking a
constructor.

id = "script" + (new Date).getTime();

Problem at line 3298 character 11: 'slice' is already defined.

slice = Array.prototype.slice;

Problem at line 3303 character 20: Confusing use of '!'.

return !!qualifier.call( elem, i, elem ) === keep;

Problem at line 3706 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3723 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3891 character 22: 'root' was used before it was
defined.

function root( elem, cur ) {

Problem at line 3990 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4049 character 25: 'i' is already defined.

for ( var i = 0; ret; i++ ) {

Problem at line 4070 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4175 character 13: Function statements cannot be
placed in blocks. Use a function expression or move the statement to
the top of the outer function.

function getWH() {

Problem at line 4281 character 24: 'name' is already defined.

for ( var name in options ) {

Problem at line 4385 character 24: Use '===' to compare with 'null'.

return val == null ?

Problem at line 4542 character 41: Bad operand.

if ( s.global && ! jQuery.active++ ) {

Problem at line 4694 character 17: 'e' is already defined.

} catch(e) { }

Problem at line 4706 character 17: 'e' is already defined.

} catch(e) {

Problem at line 4725 character 26: 'complete' was used before it was
defined.

function complete() {

Problem at line 4739 character 25: 'trigger' is already defined.

function trigger(type, args) {

Problem at line 4828 character 29: 'buildParams' was used before it
was defined.

function buildParams( prefix, obj ) {

Problem at line 4838 character 45: Use '!==' to compare with 'null'.

} else if ( !traditional && obj != null && typeof obj === "object" ) {

Problem at line 4856 character 19: Unescaped '-'.

rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,

Problem at line 4935 character 24: Use '===' to compare with 'null'.

} else if ( fn == null || bool ) {

Problem at line 4990 character 31: Use '!==' to compare with 'null'.

if ( opt.overflow != null ) {

Problem at line 5134 character 35: Use '!==' to compare with 'null'.

if ( this.elem[this.prop] != null && (!this.elem.style ||
this.elem.style[t...

Problem at line 5134 character 94: Use '===' to compare with 'null'.

if ( this.elem[this.prop] != null && (!this.elem.style ||
this.elem.style[t...

Problem at line 5195 character 43: Use '!==' to compare with 'null'.

if ( this.options.display != null ) {

Problem at line 5259 character 1: Mixed spaces and tabs.

fast: 200,

Problem at line 5260 character 1: Mixed spaces and tabs.

_default: 400

Problem at line 5269 character 60: Use '!==' to compare with 'null'.

if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {

Problem at line 5286 character 15: 'genFx' was used before it was
defined.

function genFx( type, num ) {

Problem at line 5558 character 25: Use '===' to compare with 'null'.

return size == null ? null : this;
 
L

lorlarz

Results of jQuery new production version and last production version
on JSLint
(http://www.jslint.com/)
[snip]



Don't bother running the minified versions through.  That won't be
productive.  Use the full versions.

I commented out a couple of regular expression things JSLint could not
stand and
made what I saw as about a half dozen corrections AND was able to run
all the
non-minimized _WITH_ COMMENTS REMOVED jQuery 1.4.2 through JSLint and
get
a full report.  Looks quite benigh (though there were the half dozen
errors and
a couple or regular expressions commented out).  Here is the report
AFTER those
changes:  Most, _though NOT all_ of the report, look benign AFTER all
that:

Error:
Problem at line 1 character 20: Expected an identifier and instead saw
'undefined' (a reserved word).

(function( window, undefined ) {

Problem at line 13 character 48: Unescaped '-'.

quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,

Problem at line 33 character 20: 'hasOwnProperty' is a really bad
name.

hasOwnProperty = Object.prototype.hasOwnProperty,

Problem at line 145 character 20: Use '===' to compare with 'null'.

return num == null ?

Problem at line 261 character 41: Use '!==' to compare with 'null'.

if ( (options = arguments[ i ]) != null ) {

Problem at line 356 character 48: Use '===' to compare with 'null'.

toplevel = window.frameElement == null;

Problem at line 488 character 20: Use '!==' to compare with 'null'.

if ( array != null ) {

Problem at line 489 character 31: Use '===' to compare with 'null'.

if ( array.length == null || typeof array === "string" ||
jQuery.isFunctio...

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 550 character 24: Use '!==' to compare with 'null'.

if ( value != null ) {

Problem at line 593 character 4: Mixed spaces and tabs.

[];

Problem at line 689 character 21: Missing '()' invoking a constructor.

return (new Date).getTime();

Problem at line 753 character 13: 'e' is already defined.

} catch(e) {

Problem at line 1270 character 28: Expected an assignment or function
call and instead saw an expression.

parent.selectedIndex;

Problem at line 1273 character 43: Expected an assignment or function
call and instead saw an expression.

parent.parentNode.selectedIndex;

Problem at line 1362 character 55: 'eventHandle' is already defined.

eventHandle = elemData.handle, eventHandle;

Problem at line 1471 character 106: Missing semicolon.

jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\
\.)?")...

Problem at line 1495 character 25: 'j' is already defined.

for ( var j = pos || 0; j < eventType.length; j++ ) {

Problem at line 1500 character 34: Use '===' to compare with 'null'..

if ( pos == null ) {

Problem at line 1509 character 30: Use '!==' to compare with 'null'.

if ( pos != null ) {

Problem at line 1515 character 48: Use '!==' to compare with 'null'.

if ( eventType.length === 0 || pos != null && eventType.length === 1 )
{

Problem at line 1619 character 26: 'e' is already defined.

} catch (e) {}

Problem at line 1633 character 30: Bad assignment.

event = arguments[0] = jQuery.event.fix( event || window.event );

Problem at line 1644 character 20: 'events' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1644 character 60: 'handlers' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1704 character 26: Use '===' to compare with 'null'..

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1704 character 51: Use '!==' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1955 character 19: Use '!==' to compare with 'null'.

if ( data != null || val ) {

Problem at line 2154 character 39: Use '!==' to compare with 'null'.

while ( (type = types[ i++ ]) != null ) {

Problem at line 2182 character 18: Don't make functions within a loop.

});

Problem at line 2190 character 6: Missing semicolon.

}

Problem at line 2283 character 56: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2283 character 81: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2347 character 21: 'ret' is already defined.

var ret = seed ?

Problem at line 2367 character 26: Use '===' to compare with 'null'..

if ( pop == null ) {

Problem at line 2383 character 23: 'cur' used out of scope.

Sizzle.error( cur || selector );

Problem at line 2390 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 25: 'i' is already defined.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2443 character 40: 'match' is already defined.

var type = Expr.order, match;

Problem at line 2452 character 26: Use '!==' to compare with 'null'.

if ( set != null ) {

Problem at line 2473 character 64: Use '!==' to compare with 'null'.

if ( (match = Expr.leftMatch[ type ].exec( expr )) != null &&
match[2] ) {

Problem at line 2498 character 58: Use '!==' to compare with 'null'.

for ( var i = 0; (item = curLoop) != null; i++ ) {

Problem at line 2503 character 51: Use '!==' to compare with 'null'.

if ( inplace && found != null ) {

Problem at line 2534 character 27: Use '===' to compare with 'null'..

if ( anyFound == null ) {

Problem at line 2554 character 35: Unescaped '-'.

ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2555 character 39: Unescaped '-'.

CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2556 character 48: Unescaped '-'.

NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,

Problem at line 2557 character 41: Unescaped '-'.

ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)
\3|)\s*...

Problem at line 2558 character 38: Unescaped '-'.

TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,

Problem at line 2559 character 65: Unescaped '-'.

CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,

Problem at line 2560 character 69: Unescaped '-'.

POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,

Problem at line 2561 character 39: Unescaped '-'.

PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\
(\)]*)...

Problem at line 2611 character 29: 'i' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2611 character 36: 'l' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2612 character 30: 'elem' is already defined.

var elem = checkSet;

Problem at line 2633 character 61: 'nodeCheck' used out of scope.

checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);

Problem at line 2643 character 66: 'nodeCheck' used out of scope.

checkFn("previousSibling", part, doneName, checkSet, nodeCheck,
isXML);

Problem at line 2678 character 56: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = curLoop) != null; i++ ) {

Problem at line 2758 character 29: Expected an assignment or function
call and instead saw an expression.

elem.parentNode.selectedIndex;

Problem at line 2771 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /h\d/i.test( elem.nodeName );

Problem at line 2801 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /input|select|textarea|button/i.test(elem.nodeName);

Problem at line 2841 character 29: 'i' is already defined.

for ( var i = 0, l = not.length; i < l; i++ ) {

Problem at line 2865 character 32: Expected a 'break' statement before
'case'.

node = elem;

Problem at line 2915 character 34: Use '!==' to compare with 'null'.

elem[ name ] != null ?

Problem at line 2922 character 27: Use '===' to compare with 'null'..

return result == null ?

Problem at line 2958 character 6: Don't make functions within a loop.

}));

Problem at line 2973 character 77: Expected an assignment or function
call and instead saw an expression.

Array.prototype.slice.call( document.documentElement.childNodes, 0 )
[0].node...

Problem at line 2987 character 29: 'i' is already defined.

for ( var i = 0; array; i++ ) {

Problem at line 3070 character 34: Missing '()' invoking a
constructor.

id = "script" + (new Date).getTime();

Problem at line 3298 character 11: 'slice' is already defined.

slice = Array.prototype.slice;

Problem at line 3303 character 20: Confusing use of '!'.

return !!qualifier.call( elem, i, elem ) === keep;

Problem at line 3706 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3723 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3891 character 22: 'root' was used before it was
defined.

function root( elem, cur ) {

Problem at line 3990 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4049 character 25: 'i' is already defined.

for ( var i = 0; ret; i++ ) {

Problem at line 4070 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4175 character 13: Function statements cannot be
placed in blocks. Use a function expression or move the statement to
the top of the outer function.

function getWH() {

Problem at line 4281 character 24: 'name' is already defined.

for ( var name in options ) {

Problem at line 4385 character 24: Use

read more »...


This summarizes (I believe completely) what I commented out or fixed
to make
JSLint make it all the way through: The following refers to the
development version
of 1.4.2 which you can download from http://jquery.com :

2649 changed to: var origContext = context || document; // = contents
before = contents removed


lines 2663 to 2673 commented out

2985 changed to: var nodeCheck = part.toLowerCase(); // = part
before = part removed

2995 changed to: var nodeCheck = part.toLowerCase(); // = part before
= part removed



3317 changed to Expr.match[ type ] = new
RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*
\))/.source) ); // parentheses added on expression after + sign


4167 commented out

4775 commented out


5994 prevOffsetParent = offsetParent; offsetParent =
elem.offsetParent; // (comma that was in middle changed to semi-colon)

6035 checkDiv.style.position = "fixed"; checkDiv.style.top =
"20px"; // (comma that was in middle changed to semi-colon)

6040 innerDiv.style.overflow = "hidden"; innerDiv.style.position =
"relative"; // (comma that was in middle changed to semi-colon)
 
L

lorlarz

Good luck getting your next question answered.

I thought the insulting was all in fun. Mark did it.
You mean I can't give it back?
Did you moice I used the wrong "too" ("to" instead of "too"). I also
left the 's' off of dogs. Gee, I must be *** one dumb sob *** .

I apologize if I hurt anyone's feelings. I shall try to just except
insults without giving any retort (<- good word, check your
dictionaries).

But, I am a very nice guy compared to the way I often get treated
here.
So, please forgive any small infraction.

I hope people will evaluate what I have found in my last couple of
posts.
I do very much value all your inputs. They are almost always helpful
 
L

lorlarz

Results of jQuery new production version and last production version
on JSLint
(http://www.jslint.com/)

1.4.2 ,new jQuery production version (compared to the last 'production
version', 1.3.2).
The new one seems to have about
20% more errors _and_, more importantly, seems (to me) to have more
serious errors.

**I need more opinions.**

I have a zip on my web site containing:

jQuery 1.4.2 all on one line, comments left out
jQuery 1.3.2 all on one line, comments left out
The JSLint report on each (clearly labeled).

This zip is at:http://mynichecomputing.org/JSLintCompare.zip.
Download it an unzip and
take a look.

[snip]

I have removed that zip file, since the information in the
posts below is much better.

You no longer need to see that zip.
 
D

David Mark

lorlarz said:
I thought the insulting was all in fun. Mark did it.
You mean I can't give it back?

But I wasn't insulting _you_. I referred to a Resig quote. And I am
just plain tired of the dumbing down of programming in general. Seems
like every time I read a "critique" of my stuff, it is filled with
misspelled words, odd slang, irrational conclusions and plenty of
juvenile insults to boot. Why aren't these people digging ditches?
Did you moice I used the wrong "too" ("to" instead of "too"). I also
left the 's' off of dogs. Gee, I must be *** one dumb sob *** .

You said it, not me. :)
I apologize if I hurt anyone's feelings. I shall try to just except
insults without giving any retort (<- good word, check your
dictionaries).

I think most people here will recognize that word.
But, I am a very nice guy compared to the way I often get treated
here.

Again, I didn't say anything about you. In fact, I applaud you for
applying JSLint to jQuery and even questioning the validity of the
results. That shows that you are thinking, which is more than I can say
for the typical jQuery user (if in fact that is what you are).
So, please forgive any small infraction.

Say what you want. It won't bother me. But as RF pointed out, it may
make me less likely to help you in the future.
I hope people will evaluate what I have found in my last couple of
posts.

Yes, I saw those. I'll look at them when I have a chance. But
basically it indicates what I expected (even after all of these years,
the code is still hopelessly amateurish). And I'm not at all surprised
that Resig is quick to dismiss the results. That's what he does.
That's all he does. And he absolutely will not stop until his project
is dead. :)
I do very much value all your inputs. They are almost always helpful

NP. Thanks for asking. It is good to question jQuery. If more people
would take the time to do that, perhaps it would fade away. Take bad
logic and bad style and authors who clearly won't consider anything but
their own delusions and you've got a clear candidate for history's bit
bucket.
 
D

David Mark

lorlarz said:
lorlarz said:
Results of jQuery new production version and last production version
on JSLint
(http://www.jslint.com/)
[snip]


Don't bother running the minified versions through. That won't be
productive. Use the full versions.

I commented out a couple of regular expression things JSLint could not
stand and
made what I saw as about a half dozen corrections AND was able to run
all the
non-minimized _WITH_ COMMENTS REMOVED jQuery 1.4.2 through JSLint and
get
a full report. Looks quite benigh (though there were the half dozen
errors and
a couple or regular expressions commented out). Here is the report
AFTER those
changes: Most, _though NOT all_ of the report, look benign AFTER all
that:

Error:
Problem at line 1 character 20: Expected an identifier and instead saw
'undefined' (a reserved word).

(function( window, undefined ) {

Both of those argument names are ridiculous. I'm surprised it only
flagged one of them. Of all of the names available, why would you
choose "window" unless you are trying to cause problems? I suspect they
don't pass a second argument, so they end up with an undefined variable
named "undefined". I know they don't care about ancient browsers, so I
can only assume that they are trying to squeeze a few extra characters
out of their minified version. You know code is bad when you have to
squint at the very first line to determine what the coders were trying
to accomplish (and particularly when it is obvious that they are trying
to accomplish it in the worst possible way).
Problem at line 13 character 48: Unescaped '-'.

quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,

I'm no RegExp expert, but I think JSLint is being picky there.
Problem at line 33 character 20: 'hasOwnProperty' is a really bad
name.

hasOwnProperty = Object.prototype.hasOwnProperty,

Really, really bad name. It's like every other line in this thing must
be scrutinized carefully to determine if it is not a typo. Worse still,
because this thing is so haphazardly written, you know the authors have
no reliable way to ferret out typos. This is more minification-driven
design I take it.
Problem at line 145 character 20: Use '===' to compare with 'null'.

return num == null ?

It's just ugly. Upon further inspection, it is likely that - num - can
be null or undefined, which makes you wonder just what the hell that
variable is supposed to be.
Problem at line 261 character 41: Use '!==' to compare with 'null'.

if ( (options = arguments[ i ]) != null ) {

It didn't flag the assignment in the conditional too?
Problem at line 356 character 48: Use '===' to compare with 'null'.

toplevel = window.frameElement == null;

That's rather bizarre for a host object property comparison. Again, it
makes you stop and ponder just what the hell - toplevel - is supposed to
mean (and furthermore, what the hell do the programmers _think_ it is
supposed to mean). This is already a failing grade in my book and it
appears there are tons more after this, despite the fact that the
verification couldn't even reach the halfway point.
Problem at line 488 character 20: Use '!==' to compare with 'null'.

if ( array != null ) {

I certainly don't care for - array - as a variable name either. It's
worse than - num - and why should it have the potential to be null _or_
undefined? Perhaps it doesn't and they are just being sloppy? Who knows?
Problem at line 489 character 31: Use '===' to compare with 'null'.

if ( array.length == null || typeof array === "string" ||
jQuery.isFunctio...

There's that isFunction thing again. We've been over that. The
"overloading" they do is completely inappropriate for JS. This looks
like the mother of all confused comparisons (from what I can see of it),
which is standard for such inappropriate designs. And why did they use
a strict comparison to compare two strings?
Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Dear God. If a single line of code induces an instant migraine, you've
got a serious problem. And consider who is charged with maintaining
this illegible mess. No wonder this stuff gets broken so often.
Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Again. You don't have to be a computer scientist to write scripts, but
going all-out the other way with insane constructs like this (which
would result in an instant failing grade in any first-year CS course)
precludes any possibility of success.
Problem at line 550 character 24: Use '!==' to compare with 'null'.

if ( value != null ) {

Problem at line 593 character 4: Mixed spaces and tabs.

That's just ugly.
[];

Problem at line 689 character 21: Missing '()' invoking a constructor.

return (new Date).getTime();

I haven't the slightest idea if that will cause cross-browser
compatibility issues or not (and I doubt they do either). Best to stick
to what you know and not assume it is fine because it appears to work in
the latest versions of IE, FF, Opera and Safari. I assume they just
wanted to save two characters (at a cost they can't calculate).
Problem at line 753 character 13: 'e' is already defined.

} catch(e) {

Sloppy. It shouldn't take a competent JS programmer more than an hour
to clean this slate (and then you could see issues that have the
potential for harm).
Problem at line 1270 character 28: Expected an assignment or function
call and instead saw an expression.

parent.selectedIndex;

LOL. I remember that one. Rather than checking the selectedIndex to
get the information they need, they prefer to resort to a mystical
incantation (that "works" because they saw it work once) and then check
some other property. This is about as hare-brained as it gets (in any
language).
Problem at line 1273 character 43: Expected an assignment or function
call and instead saw an expression.

parent.parentNode.selectedIndex;

Yes, I'm partially responsible for doubling this particular incantation
(by proxy of course). Sorry, but I really tried to give them the right
answer (they just took the bits they thought were justified).
Problem at line 1362 character 55: 'eventHandle' is already defined.

eventHandle = elemData.handle, eventHandle;

WTF?! It could be a typo or it could just be a very bizarre construct.
You've really got to feel for anyone who has to wade through this stuff
on a regular basis. Perhaps that explains the snail's pace of their
"progress" over the last few years. Who would subject themselves to
fiddling around with such nonsense?
Problem at line 1471 character 106: Missing semicolon.

That's not going to be good for minification.
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\
\.)?")...

Problem at line 1495 character 25: 'j' is already defined.

for ( var j = pos || 0; j < eventType.length; j++ ) {

Sloppy. Again, makes you wonder if there is a mistake or not. This is
just not how competent software is developed.
Problem at line 1500 character 34: Use '===' to compare with 'null'.

if ( pos == null ) {

Problem at line 1509 character 30: Use '!==' to compare with 'null'.

if ( pos != null ) {

Problem at line 1515 character 48: Use '!==' to compare with 'null'.

if ( eventType.length === 0 || pos != null && eventType.length === 1 )
{

They mix and match strict and loose like it doesn't matter. Who knows
if they fat-fingered the key or really wanted to write the most obscure
code possible?
Problem at line 1619 character 26: 'e' is already defined.

} catch (e) {}

Problem at line 1633 character 30: Bad assignment.

event = arguments[0] = jQuery.event.fix( event || window.event );

Bad assignment indeed. Never seen that one before.
Problem at line 1644 character 20: 'events' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Typo or not? Hard to say without wading through additional code.
Problem at line 1644 character 60: 'handlers' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];
Same.


Problem at line 1704 character 26: Use '===' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Again with the nutty host property comparisons. Do they really expect
those properties to be null?
Problem at line 1704 character 51: Use '!==' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1955 character 19: Use '!==' to compare with 'null'.

if ( data != null || val ) {

Problem at line 2154 character 39: Use '!==' to compare with 'null'.

while ( (type = types[ i++ ]) != null ) {

Problem at line 2182 character 18: Don't make functions within a loop.

});

I am not sure if that one is valid or not. The idea is that it could
create the same function multiple times for no reason (so why not create
it once before entering the loop?) I fixed a few of those in My Library
a ways back. I don't know for sure that it helped anything, but I know
it couldn't have hurt anything.
Problem at line 2190 character 6: Missing semicolon.

}

Odd for a project so obsessed with minification. I guess their bloat is
starting to get them down (up to a required minimum of 70K minified IIRC).
Problem at line 2283 character 56: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

That makes my eyes hurt.
Problem at line 2283 character 81: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...
Same.


Problem at line 2347 character 21: 'ret' is already defined.

var ret = seed ?

Problem at line 2367 character 26: Use '===' to compare with 'null'.

if ( pop == null ) {

Problem at line 2383 character 23: 'cur' used out of scope.

That means they declared the variable in a block. As there is no block
scope in JS, it won't cause a problem, but could confuse readers
(especially those coming from other languages).
Sizzle.error( cur || selector );

Problem at line 2390 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 25: 'i' is already defined.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2443 character 40: 'match' is already defined.

var type = Expr.order, match;

Problem at line 2452 character 26: Use '!==' to compare with 'null'.

if ( set != null ) {

Problem at line 2473 character 64: Use '!==' to compare with 'null'.

if ( (match = Expr.leftMatch[ type ].exec( expr )) != null &&
match[2] ) {

Problem at line 2498 character 58: Use '!==' to compare with 'null'.

for ( var i = 0; (item = curLoop) != null; i++ ) {

Problem at line 2503 character 51: Use '!==' to compare with 'null'.

if ( inplace && found != null ) {

Problem at line 2534 character 27: Use '===' to compare with 'null'.

if ( anyFound == null ) {


Sheesh! Not very exacting are they? Seeing as
Problem at line 2554 character 35: Unescaped '-'.

ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2555 character 39: Unescaped '-'.

CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2556 character 48: Unescaped '-'.

NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,

Problem at line 2557 character 41: Unescaped '-'.

ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)
\3|)\s*...

Problem at line 2558 character 38: Unescaped '-'.

TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,

Problem at line 2559 character 65: Unescaped '-'.

CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,

Problem at line 2560 character 69: Unescaped '-'.

POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,

Problem at line 2561 character 39: Unescaped '-'.

PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\
(\)]*)...

Again, not sure on those. These appear to be the selector parsing
expressions. I avoided using Regular expressions there, though my own
parsing has gotten fairly messy too (nothing compared to this stuff though).
Problem at line 2611 character 29: 'i' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2611 character 36: 'l' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2612 character 30: 'elem' is already defined.

var elem = checkSet;

Problem at line 2633 character 61: 'nodeCheck' used out of scope.

checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);

Problem at line 2643 character 66: 'nodeCheck' used out of scope.

checkFn("previousSibling", part, doneName, checkSet, nodeCheck,
isXML);

Problem at line 2678 character 56: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = curLoop) != null; i++ ) {

Problem at line 2758 character 29: Expected an assignment or function
call and instead saw an expression.

elem.parentNode.selectedIndex;


Again?! That's right, they did that stupid spell in two places, so they
actually quadrupled it after my input. Odd for people so concerned with
file size.
Problem at line 2771 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /h\d/i.test( elem.nodeName );

I don't think it will cause problems, but then I haven't tested every
browser ever made. ;)
Problem at line 2801 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /input|select|textarea|button/i.test(elem.nodeName);

Problem at line 2841 character 29: 'i' is already defined.

for ( var i = 0, l = not.length; i < l; i++ ) {

Problem at line 2865 character 32: Expected a 'break' statement before
'case'.

node = elem;

Problem at line 2915 character 34: Use '!==' to compare with 'null'.

elem[ name ] != null ?

Problem at line 2922 character 27: Use '===' to compare with 'null'.

return result == null ?

Problem at line 2958 character 6: Don't make functions within a loop.

}));

Problem at line 2973 character 77: Expected an assignment or function
call and instead saw an expression.

Array.prototype.slice.call( document.documentElement.childNodes, 0 )
[0].node...

Problem at line 2987 character 29: 'i' is already defined.

for ( var i = 0; array; i++ ) {

Problem at line 3070 character 34: Missing '()' invoking a
constructor.

id = "script" + (new Date).getTime();

Problem at line 3298 character 11: 'slice' is already defined.

slice = Array.prototype.slice;

Problem at line 3303 character 20: Confusing use of '!'.

return !!qualifier.call( elem, i, elem ) === keep;


That's about enough. As I've said before, avoid this junk like the
plague. This is simply another level of validation for that basic
message. Of course, most Web developers don't get it as they see all
scripts as indecipherable voodoo.
 
D

David Mark

lorlarz wrote:

[...]
This summarizes (I believe completely) what I commented out or fixed
to make
JSLint make it all the way through: The following refers to the
development version
of 1.4.2 which you can download from http://jquery.com :

No thanks! :)
2649 changed to: var origContext = context || document; // = contents
before = contents removed


lines 2663 to 2673 commented out
LOL.


2985 changed to: var nodeCheck = part.toLowerCase(); // = part
before = part removed

2995 changed to: var nodeCheck = part.toLowerCase(); // = part before
= part removed
Huh?




3317 changed to Expr.match[ type ] = new
RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*
\))/.source) ); // parentheses added on expression after + sign


4167 commented out

4775 commented out


5994 prevOffsetParent = offsetParent; offsetParent =
elem.offsetParent; // (comma that was in middle changed to semi-colon)

6035 checkDiv.style.position = "fixed"; checkDiv.style.top =
"20px"; // (comma that was in middle changed to semi-colon)

6040 innerDiv.style.overflow = "hidden"; innerDiv.style.position =
"relative"; // (comma that was in middle changed to semi-colon)

Yeah, I hate that one. Dojo was (is) chock full of those too. Makes
you stop and wonder if there is a missing "var".
 
L

lorlarz

Results of jQuery new production version and last production version
on JSLint
(http://www.jslint.com/)
[snip]



Don't bother running the minified versions through.  That won't be
productive.  Use the full versions.

I commented out a couple of regular expression things JSLint could not
stand and
made what I saw as about a half dozen corrections AND was able to run
all the
non-minimized _WITH_ COMMENTS REMOVED jQuery 1.4.2 through JSLint and
get
a full report.  Looks quite benigh (though there were the half dozen
errors and
a couple or regular expressions commented out).  Here is the report
AFTER those
changes:  Most, _though NOT all_ of the report, look benign AFTER all
that:

Error:
Problem at line 1 character 20: Expected an identifier and instead saw
'undefined' (a reserved word).

(function( window, undefined ) {

Problem at line 13 character 48: Unescaped '-'.

quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,

Problem at line 33 character 20: 'hasOwnProperty' is a really bad
name.

hasOwnProperty = Object.prototype.hasOwnProperty,

Problem at line 145 character 20: Use '===' to compare with 'null'.

return num == null ?

Problem at line 261 character 41: Use '!==' to compare with 'null'.

if ( (options = arguments[ i ]) != null ) {

Problem at line 356 character 48: Use '===' to compare with 'null'.

toplevel = window.frameElement == null;

Problem at line 488 character 20: Use '!==' to compare with 'null'.

if ( array != null ) {

Problem at line 489 character 31: Use '===' to compare with 'null'.

if ( array.length == null || typeof array === "string" ||
jQuery.isFunctio...

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 550 character 24: Use '!==' to compare with 'null'.

if ( value != null ) {

Problem at line 593 character 4: Mixed spaces and tabs.

[];

Problem at line 689 character 21: Missing '()' invoking a constructor.

return (new Date).getTime();

Problem at line 753 character 13: 'e' is already defined.

} catch(e) {

Problem at line 1270 character 28: Expected an assignment or function
call and instead saw an expression.

parent.selectedIndex;

Problem at line 1273 character 43: Expected an assignment or function
call and instead saw an expression.

parent.parentNode.selectedIndex;

Problem at line 1362 character 55: 'eventHandle' is already defined.

eventHandle = elemData.handle, eventHandle;

Problem at line 1471 character 106: Missing semicolon.

jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\
\.)?")...

Problem at line 1495 character 25: 'j' is already defined.

for ( var j = pos || 0; j < eventType.length; j++ ) {

Problem at line 1500 character 34: Use '===' to compare with 'null'..

if ( pos == null ) {

Problem at line 1509 character 30: Use '!==' to compare with 'null'.

if ( pos != null ) {

Problem at line 1515 character 48: Use '!==' to compare with 'null'.

if ( eventType.length === 0 || pos != null && eventType.length === 1 )
{

Problem at line 1619 character 26: 'e' is already defined.

} catch (e) {}

Problem at line 1633 character 30: Bad assignment.

event = arguments[0] = jQuery.event.fix( event || window.event );

Problem at line 1644 character 20: 'events' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1644 character 60: 'handlers' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1704 character 26: Use '===' to compare with 'null'..

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1704 character 51: Use '!==' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1955 character 19: Use '!==' to compare with 'null'.

if ( data != null || val ) {

Problem at line 2154 character 39: Use '!==' to compare with 'null'.

while ( (type = types[ i++ ]) != null ) {

Problem at line 2182 character 18: Don't make functions within a loop.

});

Problem at line 2190 character 6: Missing semicolon.

}

Problem at line 2283 character 56: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2283 character 81: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2347 character 21: 'ret' is already defined.

var ret = seed ?

Problem at line 2367 character 26: Use '===' to compare with 'null'..

if ( pop == null ) {

Problem at line 2383 character 23: 'cur' used out of scope.

Sizzle.error( cur || selector );

Problem at line 2390 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 25: 'i' is already defined.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2443 character 40: 'match' is already defined.

var type = Expr.order, match;

Problem at line 2452 character 26: Use '!==' to compare with 'null'.

if ( set != null ) {

Problem at line 2473 character 64: Use '!==' to compare with 'null'.

if ( (match = Expr.leftMatch[ type ].exec( expr )) != null &&
match[2] ) {

Problem at line 2498 character 58: Use '!==' to compare with 'null'.

for ( var i = 0; (item = curLoop) != null; i++ ) {

Problem at line 2503 character 51: Use '!==' to compare with 'null'.

if ( inplace && found != null ) {

Problem at line 2534 character 27: Use '===' to compare with 'null'..

if ( anyFound == null ) {

Problem at line 2554 character 35: Unescaped '-'.

ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2555 character 39: Unescaped '-'.

CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2556 character 48: Unescaped '-'.

NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,

Problem at line 2557 character 41: Unescaped '-'.

ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)
\3|)\s*...

Problem at line 2558 character 38: Unescaped '-'.

TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,

Problem at line 2559 character 65: Unescaped '-'.

CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,

Problem at line 2560 character 69: Unescaped '-'.

POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,

Problem at line 2561 character 39: Unescaped '-'.

PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\
(\)]*)...

Problem at line 2611 character 29: 'i' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2611 character 36: 'l' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2612 character 30: 'elem' is already defined.

var elem = checkSet;

Problem at line 2633 character 61: 'nodeCheck' used out of scope.

checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);

Problem at line 2643 character 66: 'nodeCheck' used out of scope.

checkFn("previousSibling", part, doneName, checkSet, nodeCheck,
isXML);

Problem at line 2678 character 56: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = curLoop) != null; i++ ) {

Problem at line 2758 character 29: Expected an assignment or function
call and instead saw an expression.

elem.parentNode.selectedIndex;

Problem at line 2771 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /h\d/i.test( elem.nodeName );

Problem at line 2801 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /input|select|textarea|button/i.test(elem.nodeName);

Problem at line 2841 character 29: 'i' is already defined.

for ( var i = 0, l = not.length; i < l; i++ ) {

Problem at line 2865 character 32: Expected a 'break' statement before
'case'.

node = elem;

Problem at line 2915 character 34: Use '!==' to compare with 'null'.

elem[ name ] != null ?

Problem at line 2922 character 27: Use '===' to compare with 'null'..

return result == null ?

Problem at line 2958 character 6: Don't make functions within a loop.

}));

Problem at line 2973 character 77: Expected an assignment or function
call and instead saw an expression.

Array.prototype.slice.call( document.documentElement.childNodes, 0 )
[0].node...

Problem at line 2987 character 29: 'i' is already defined.

for ( var i = 0; array; i++ ) {

Problem at line 3070 character 34: Missing '()' invoking a
constructor.

id = "script" + (new Date).getTime();

Problem at line 3298 character 11: 'slice' is already defined.

slice = Array.prototype.slice;

Problem at line 3303 character 20: Confusing use of '!'.

return !!qualifier.call( elem, i, elem ) === keep;

Problem at line 3706 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3723 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3891 character 22: 'root' was used before it was
defined.

function root( elem, cur ) {

Problem at line 3990 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4049 character 25: 'i' is already defined.

for ( var i = 0; ret; i++ ) {

Problem at line 4070 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4175 character 13: Function statements cannot be
placed in blocks. Use a function expression or move the statement to
the top of the outer function.

function getWH() {

Problem at line 4281 character 24: 'name' is already defined.

for ( var name in options ) {

Problem at line 4385 character 24: Use

read more »...
 
L

lorlarz

Results of jQuery new production version and last production version
on JSLint
(http://www.jslint.com/)
[snip]



Don't bother running the minified versions through.  That won't be
productive.  Use the full versions.

I commented out a couple of regular expression things JSLint could not
stand and
made what I saw as about a half dozen corrections AND was able to run
all the
non-minimized _WITH_ COMMENTS REMOVED jQuery 1.4.2 through JSLint and
get
a full report.  Looks quite benigh (though there were the half dozen
errors and
a couple or regular expressions commented out).  Here is the report
AFTER those
changes:  Most, _though NOT all_ of the report, look benign AFTER all
that:

Error:
Problem at line 1 character 20: Expected an identifier and instead saw
'undefined' (a reserved word).

(function( window, undefined ) {

Problem at line 13 character 48: Unescaped '-'.

quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,

Problem at line 33 character 20: 'hasOwnProperty' is a really bad
name.

hasOwnProperty = Object.prototype.hasOwnProperty,

Problem at line 145 character 20: Use '===' to compare with 'null'.

return num == null ?

Problem at line 261 character 41: Use '!==' to compare with 'null'.

if ( (options = arguments[ i ]) != null ) {

Problem at line 356 character 48: Use '===' to compare with 'null'.

toplevel = window.frameElement == null;

Problem at line 488 character 20: Use '!==' to compare with 'null'.

if ( array != null ) {

Problem at line 489 character 31: Use '===' to compare with 'null'.

if ( array.length == null || typeof array === "string" ||
jQuery.isFunctio...

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 550 character 24: Use '!==' to compare with 'null'.

if ( value != null ) {

Problem at line 593 character 4: Mixed spaces and tabs.

[];

Problem at line 689 character 21: Missing '()' invoking a constructor.

return (new Date).getTime();

Problem at line 753 character 13: 'e' is already defined.

} catch(e) {

Problem at line 1270 character 28: Expected an assignment or function
call and instead saw an expression.

parent.selectedIndex;

Problem at line 1273 character 43: Expected an assignment or function
call and instead saw an expression.

parent.parentNode.selectedIndex;

Problem at line 1362 character 55: 'eventHandle' is already defined.

eventHandle = elemData.handle, eventHandle;

Problem at line 1471 character 106: Missing semicolon.

jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\
\.)?")...

Problem at line 1495 character 25: 'j' is already defined.

for ( var j = pos || 0; j < eventType.length; j++ ) {

Problem at line 1500 character 34: Use '===' to compare with 'null'..

if ( pos == null ) {

Problem at line 1509 character 30: Use '!==' to compare with 'null'.

if ( pos != null ) {

Problem at line 1515 character 48: Use '!==' to compare with 'null'.

if ( eventType.length === 0 || pos != null && eventType.length === 1 )
{

Problem at line 1619 character 26: 'e' is already defined.

} catch (e) {}

Problem at line 1633 character 30: Bad assignment.

event = arguments[0] = jQuery.event.fix( event || window.event );

Problem at line 1644 character 20: 'events' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1644 character 60: 'handlers' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1704 character 26: Use '===' to compare with 'null'..

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1704 character 51: Use '!==' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1955 character 19: Use '!==' to compare with 'null'.

if ( data != null || val ) {

Problem at line 2154 character 39: Use '!==' to compare with 'null'.

while ( (type = types[ i++ ]) != null ) {

Problem at line 2182 character 18: Don't make functions within a loop.

});

Problem at line 2190 character 6: Missing semicolon.

}

Problem at line 2283 character 56: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2283 character 81: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2347 character 21: 'ret' is already defined.

var ret = seed ?

Problem at line 2367 character 26: Use '===' to compare with 'null'..

if ( pop == null ) {

Problem at line 2383 character 23: 'cur' used out of scope.

Sizzle.error( cur || selector );

Problem at line 2390 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 25: 'i' is already defined.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2443 character 40: 'match' is already defined.

var type = Expr.order, match;

Problem at line 2452 character 26: Use '!==' to compare with 'null'.

if ( set != null ) {

Problem at line 2473 character 64: Use '!==' to compare with 'null'.

if ( (match = Expr.leftMatch[ type ].exec( expr )) != null &&
match[2] ) {

Problem at line 2498 character 58: Use '!==' to compare with 'null'.

for ( var i = 0; (item = curLoop) != null; i++ ) {

Problem at line 2503 character 51: Use '!==' to compare with 'null'.

if ( inplace && found != null ) {

Problem at line 2534 character 27: Use '===' to compare with 'null'..

if ( anyFound == null ) {

Problem at line 2554 character 35: Unescaped '-'.

ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2555 character 39: Unescaped '-'.

CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2556 character 48: Unescaped '-'.

NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,

Problem at line 2557 character 41: Unescaped '-'.

ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)
\3|)\s*...

Problem at line 2558 character 38: Unescaped '-'.

TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,

Problem at line 2559 character 65: Unescaped '-'.

CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,

Problem at line 2560 character 69: Unescaped '-'.

POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,

Problem at line 2561 character 39: Unescaped '-'.

PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\
(\)]*)...

Problem at line 2611 character 29: 'i' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2611 character 36: 'l' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2612 character 30: 'elem' is already defined.

var elem = checkSet;

Problem at line 2633 character 61: 'nodeCheck' used out of scope.

checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);

Problem at line 2643 character 66: 'nodeCheck' used out of scope.

checkFn("previousSibling", part, doneName, checkSet, nodeCheck,
isXML);

Problem at line 2678 character 56: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = curLoop) != null; i++ ) {

Problem at line 2758 character 29: Expected an assignment or function
call and instead saw an expression.

elem.parentNode.selectedIndex;

Problem at line 2771 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /h\d/i.test( elem.nodeName );

Problem at line 2801 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /input|select|textarea|button/i.test(elem.nodeName);

Problem at line 2841 character 29: 'i' is already defined.

for ( var i = 0, l = not.length; i < l; i++ ) {

Problem at line 2865 character 32: Expected a 'break' statement before
'case'.

node = elem;

Problem at line 2915 character 34: Use '!==' to compare with 'null'.

elem[ name ] != null ?

Problem at line 2922 character 27: Use '===' to compare with 'null'..

return result == null ?

Problem at line 2958 character 6: Don't make functions within a loop.

}));

Problem at line 2973 character 77: Expected an assignment or function
call and instead saw an expression.

Array.prototype.slice.call( document.documentElement.childNodes, 0 )
[0].node...

Problem at line 2987 character 29: 'i' is already defined.

for ( var i = 0; array; i++ ) {

Problem at line 3070 character 34: Missing '()' invoking a
constructor.

id = "script" + (new Date).getTime();

Problem at line 3298 character 11: 'slice' is already defined.

slice = Array.prototype.slice;

Problem at line 3303 character 20: Confusing use of '!'.

return !!qualifier.call( elem, i, elem ) === keep;

Problem at line 3706 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3723 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3891 character 22: 'root' was used before it was
defined.

function root( elem, cur ) {

Problem at line 3990 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4049 character 25: 'i' is already defined.

for ( var i = 0; ret; i++ ) {

Problem at line 4070 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4175 character 13: Function statements cannot be
placed in blocks. Use a function expression or move the statement to
the top of the outer function.

function getWH() {

Problem at line 4281 character 24: 'name' is already defined.

for ( var name in options ) {

Problem at line 4385 character 24: Use '===' to compare with 'null'..

return val == null ?

Problem at line 4542 character 41: Bad operand.

if ( s.global && ! jQuery.active++ ) {

Problem at line 4694 character 17: 'e' is already defined.

} catch(e) { }

Problem at line 4706 character 17: 'e' is already defined.

} catch(e) {

Problem at line 4725 character 26: 'complete' was used before it was
defined.

function complete() {

Problem at line 4739 character 25: 'trigger' is already defined.

function trigger(type, args) {

Problem at line 4828 character 29: 'buildParams' was used before it
was defined.

function buildParams( prefix, obj ) {

Problem at line 4838 character 45: Use '!==' to compare with 'null'.

} else if ( !traditional && obj != null && typeof obj === "object" ) {

Problem at line 4856 character 19: Unescaped '-'.

rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,

Problem at line 4935 character 24: Use '===' to compare with 'null'..

} else if ( fn == null || bool ) {

Problem at line 4990 character 31: Use '!==' to compare with 'null'.

if ( opt.overflow != null ) {

Problem at line 5134 character 35: Use '!==' to compare with 'null'.

if ( this.elem[this.prop] != null && (!this.elem.style ||
this.elem.style[t...

Problem at line 5134 character 94: Use '===' to compare with 'null'..

if ( this.elem[this.prop] != null && (!this.elem.style ||
this.elem.style[t...

Problem at line 5195 character 43: Use '!==' to compare with 'null'.

if ( this.options.display != null ) {

Problem at line 5259 character 1: Mixed spaces and tabs.

fast: 200,

Problem at line 5260 character 1: Mixed spaces and tabs.

_default: 400

Problem at line 5269 character 60: Use '!==' to compare with 'null'.

if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {

Problem at line 5286 character 15: 'genFx' was used before it was
defined.

function genFx( type, num ) {

Problem at line 5558 character 25: Use '===' to compare with 'null'..

return size == null ? null : this;


It occurs to me it would be useful to provide modified jquery txt --
1.4.2 the corrected and commented out
version (with comments OTHERWISE deleted) SO you can line up the line
numbers in the report, quoted above with the actual lines of text
where the errors occur. FOR this I provide that modified 1.4.2 I fed
in the get the JSLint report. You can find it at:

http://mynichecomputing.org/modJTjquery-1_4_2.txt
 
D

David Mark

lorlarz said:
Results of jQuery new production version and last production version
on JSLint
(http://www.jslint.com/) [snip]



Don't bother running the minified versions through. That won't be
productive. Use the full versions.
I commented out a couple of regular expression things JSLint could not
stand and
made what I saw as about a half dozen corrections AND was able to run
all the
non-minimized _WITH_ COMMENTS REMOVED jQuery 1.4.2 through JSLint and
get
a full report. Looks quite benigh (though there were the half dozen
errors and
a couple or regular expressions commented out). Here is the report
AFTER those
changes: Most, _though NOT all_ of the report, look benign AFTER all
that:

Error:
Problem at line 1 character 20: Expected an identifier and instead saw
'undefined' (a reserved word).

(function( window, undefined ) {

Problem at line 13 character 48: Unescaped '-'.

quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,

Problem at line 33 character 20: 'hasOwnProperty' is a really bad
name.

hasOwnProperty = Object.prototype.hasOwnProperty,

Problem at line 145 character 20: Use '===' to compare with 'null'.

return num == null ?

Problem at line 261 character 41: Use '!==' to compare with 'null'.

if ( (options = arguments[ i ]) != null ) {

Problem at line 356 character 48: Use '===' to compare with 'null'.

toplevel = window.frameElement == null;

Problem at line 488 character 20: Use '!==' to compare with 'null'.

if ( array != null ) {

Problem at line 489 character 31: Use '===' to compare with 'null'.

if ( array.length == null || typeof array === "string" ||
jQuery.isFunctio...

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 536 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 550 character 24: Use '!==' to compare with 'null'.

if ( value != null ) {

Problem at line 593 character 4: Mixed spaces and tabs.

[];

Problem at line 689 character 21: Missing '()' invoking a constructor.

return (new Date).getTime();

Problem at line 753 character 13: 'e' is already defined.

} catch(e) {

Problem at line 1270 character 28: Expected an assignment or function
call and instead saw an expression.

parent.selectedIndex;

Problem at line 1273 character 43: Expected an assignment or function
call and instead saw an expression.

parent.parentNode.selectedIndex;

Problem at line 1362 character 55: 'eventHandle' is already defined.

eventHandle = elemData.handle, eventHandle;

Problem at line 1471 character 106: Missing semicolon.

jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\
\.)?")...

Problem at line 1495 character 25: 'j' is already defined.

for ( var j = pos || 0; j < eventType.length; j++ ) {

Problem at line 1500 character 34: Use '===' to compare with 'null'.

if ( pos == null ) {

Problem at line 1509 character 30: Use '!==' to compare with 'null'.

if ( pos != null ) {

Problem at line 1515 character 48: Use '!==' to compare with 'null'.

if ( eventType.length === 0 || pos != null && eventType.length === 1 )
{

Problem at line 1619 character 26: 'e' is already defined.

} catch (e) {}

Problem at line 1633 character 30: Bad assignment.

event = arguments[0] = jQuery.event.fix( event || window.event );

Problem at line 1644 character 20: 'events' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1644 character 60: 'handlers' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1704 character 26: Use '===' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1704 character 51: Use '!==' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1955 character 19: Use '!==' to compare with 'null'.

if ( data != null || val ) {

Problem at line 2154 character 39: Use '!==' to compare with 'null'.

while ( (type = types[ i++ ]) != null ) {

Problem at line 2182 character 18: Don't make functions within a loop.

});

Problem at line 2190 character 6: Missing semicolon.

}

Problem at line 2283 character 56: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2283 character 81: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2347 character 21: 'ret' is already defined.

var ret = seed ?

Problem at line 2367 character 26: Use '===' to compare with 'null'.

if ( pop == null ) {

Problem at line 2383 character 23: 'cur' used out of scope.

Sizzle.error( cur || selector );

Problem at line 2390 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 25: 'i' is already defined.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2396 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2443 character 40: 'match' is already defined.

var type = Expr.order, match;

Problem at line 2452 character 26: Use '!==' to compare with 'null'.

if ( set != null ) {

Problem at line 2473 character 64: Use '!==' to compare with 'null'.

if ( (match = Expr.leftMatch[ type ].exec( expr )) != null &&
match[2] ) {

Problem at line 2498 character 58: Use '!==' to compare with 'null'.

for ( var i = 0; (item = curLoop) != null; i++ ) {

Problem at line 2503 character 51: Use '!==' to compare with 'null'.

if ( inplace && found != null ) {

Problem at line 2534 character 27: Use '===' to compare with 'null'.

if ( anyFound == null ) {

Problem at line 2554 character 35: Unescaped '-'.

ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2555 character 39: Unescaped '-'.

CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2556 character 48: Unescaped '-'.

NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,

Problem at line 2557 character 41: Unescaped '-'.

ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)
\3|)\s*...

Problem at line 2558 character 38: Unescaped '-'.

TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,

Problem at line 2559 character 65: Unescaped '-'.

CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,

Problem at line 2560 character 69: Unescaped '-'.

POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,

Problem at line 2561 character 39: Unescaped '-'.

PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\
(\)]*)...

Problem at line 2611 character 29: 'i' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2611 character 36: 'l' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2612 character 30: 'elem' is already defined.

var elem = checkSet;

Problem at line 2633 character 61: 'nodeCheck' used out of scope.

checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);

Problem at line 2643 character 66: 'nodeCheck' used out of scope.

checkFn("previousSibling", part, doneName, checkSet, nodeCheck,
isXML);

Problem at line 2678 character 56: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = curLoop) != null; i++ ) {

Problem at line 2758 character 29: Expected an assignment or function
call and instead saw an expression.

elem.parentNode.selectedIndex;

Problem at line 2771 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /h\d/i.test( elem.nodeName );

Problem at line 2801 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /input|select|textarea|button/i.test(elem.nodeName);

Problem at line 2841 character 29: 'i' is already defined.

for ( var i = 0, l = not.length; i < l; i++ ) {

Problem at line 2865 character 32: Expected a 'break' statement before
'case'.

node = elem;

Problem at line 2915 character 34: Use '!==' to compare with 'null'.

elem[ name ] != null ?

Problem at line 2922 character 27: Use '===' to compare with 'null'.

return result == null ?

Problem at line 2958 character 6: Don't make functions within a loop.

}));

Problem at line 2973 character 77: Expected an assignment or function
call and instead saw an expression.

Array.prototype.slice.call( document.documentElement.childNodes, 0 )
[0].node...

Problem at line 2987 character 29: 'i' is already defined.

for ( var i = 0; array; i++ ) {

Problem at line 3070 character 34: Missing '()' invoking a
constructor.

id = "script" + (new Date).getTime();

Problem at line 3298 character 11: 'slice' is already defined.

slice = Array.prototype.slice;

Problem at line 3303 character 20: Confusing use of '!'.

return !!qualifier.call( elem, i, elem ) === keep;

Problem at line 3706 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3723 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 3891 character 22: 'root' was used before it was
defined.

function root( elem, cur ) {

Problem at line 3990 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4049 character 25: 'i' is already defined.

for ( var i = 0; ret; i++ ) {

Problem at line 4070 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4175 character 13: Function statements cannot be
placed in blocks. Use a function expression or move the statement to
the top of the outer function.

function getWH() {

Problem at line 4281 character 24: 'name' is already defined.

for ( var name in options ) {

Problem at line 4385 character 24: Use '===' to compare with 'null'.

return val == null ?

Problem at line 4542 character 41: Bad operand.

if ( s.global && ! jQuery.active++ ) {

Problem at line 4694 character 17: 'e' is already defined.

} catch(e) { }

Problem at line 4706 character 17: 'e' is already defined.

} catch(e) {

Problem at line 4725 character 26: 'complete' was used before it was
defined.

function complete() {

Problem at line 4739 character 25: 'trigger' is already defined.

function trigger(type, args) {

Problem at line 4828 character 29: 'buildParams' was used before it
was defined.

function buildParams( prefix, obj ) {

Problem at line 4838 character 45: Use '!==' to compare with 'null'.

} else if ( !traditional && obj != null && typeof obj === "object" ) {

Problem at line 4856 character 19: Unescaped '-'.

rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,

Problem at line 4935 character 24: Use '===' to compare with 'null'.

} else if ( fn == null || bool ) {

Problem at line 4990 character 31: Use '!==' to compare with 'null'.

if ( opt.overflow != null ) {

Problem at line 5134 character 35: Use '!==' to compare with 'null'.

if ( this.elem[this.prop] != null && (!this.elem.style ||
this.elem.style[t...

Problem at line 5134 character 94: Use '===' to compare with 'null'.

if ( this.elem[this.prop] != null && (!this.elem.style ||
this.elem.style[t...

Problem at line 5195 character 43: Use '!==' to compare with 'null'.

if ( this.options.display != null ) {

Problem at line 5259 character 1: Mixed spaces and tabs.

fast: 200,

Problem at line 5260 character 1: Mixed spaces and tabs.

_default: 400

Problem at line 5269 character 60: Use '!==' to compare with 'null'.

if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {

Problem at line 5286 character 15: 'genFx' was used before it was
defined.

function genFx( type, num ) {

Problem at line 5558 character 25: Use '===' to compare with 'null'.

return size == null ? null : this;


It occurs to me it would be useful to provide modified jquery txt --
1.4.2 the corrected and commented out
version (with comments OTHERWISE deleted) SO you can line up the line
numbers in the report, quoted above with the actual lines of text
where the errors occur. FOR this I provide that modified 1.4.2 I fed
in the get the JSLint report. You can find it at:

http://mynichecomputing.org/modJTjquery-1_4_2.txt


Thanks, but it doesn't really matter. Even if _all_ of those issues
turn out to be "benign", their very presence ensures mass confusion for
those who have to maintain the code (and we know that they are not
exactly proficient with JS to begin with).
 
M

Michael Haufe (\TNO\)

lorlarz said:
if ( (options = arguments[ i ]) != null ) {

David said:
It didn't flag the assignment in the conditional too?

Common practice dictates that the extra parenthesis make explicit that
the assignment was intentional. Mozilla strict warnings honor this
pattern. Perhaps other engines do as well but I haven't tested.
 
D

David Mark

Michael said:
lorlarz said:
if ( (options = arguments[ i ]) != null ) {

David said:
It didn't flag the assignment in the conditional too?

Common practice dictates that the extra parenthesis make explicit that
the assignment was intentional. Mozilla strict warnings honor this
pattern. Perhaps other engines do as well but I haven't tested.

Thanks, I missed that. So many warnings, so little time. :)

I'm not big on Mozilla strict mode though. IIRC, many of its warnings
are arbitrary (even more so than JSLint). Complaining about anonymous
functions that don't return anything comes to mind.
 
L

lorlarz

[snip]

For convenience, I thought it would be good to just refer to ONE file
(one document) regarding all the changes I needed to make to get
jQuery 1.4.2 all the way through JSLint **_AND_** the remaining
errors found (in particular, their line numbers) NOW referring to the
SAME jQuery 1.4.2 Development Verson (obtainable from http://jquery.ocm
).

OK. Here it is. Directions: Simply make the following changes to
the Development version of jQuery 1.4.2 :

2649 changed to: var origContext = context || document; // = contents
before = contents removed


lines 2663 to 2673 commented out

2985 changed to: var nodeCheck = part.toLowerCase(); // = part
before = part removed

2995 changed to: var nodeCheck = part.toLowerCase(); // = part before
= part removed



3317 changed to Expr.match[ type ] = new
RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*
\))/.source) ); // parentheses added on expression after + sign


4167 commented out

4775 commented out


5994 prevOffsetParent = offsetParent; offsetParent =
elem.offsetParent; // (comma in middle changed to semi-colon)

6035 checkDiv.style.position = "fixed"; checkDiv.style.top =
"20px"; // (comma in middle changed to semi-colon)

6040 innerDiv.style.overflow = "hidden"; innerDiv.style.position =
"relative"; // (comma in middle changed to semi-colon)

***********************
***********************


**THEN** run that file (documewnt) as so changed through JSLint and
you get the following
error report of remaining errors: (line numbers now referring to lines
in that document):

Error:
Problem at line 16 character 20: Expected an identifier and instead
saw 'undefined' (a reserved word).

(function( window, undefined ) {

Problem at line 38 character 48: Unescaped '-'.

quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,

Problem at line 69 character 20: 'hasOwnProperty' is a really bad
name.

hasOwnProperty = Object.prototype.hasOwnProperty,

Problem at line 204 character 20: Use '===' to compare with 'null'.

return num == null ?

Problem at line 330 character 41: Use '!==' to compare with 'null'.

if ( (options = arguments[ i ]) != null ) {

Problem at line 441 character 48: Use '===' to compare with 'null'.

toplevel = window.frameElement == null;

Problem at line 595 character 20: Use '!==' to compare with 'null'.

if ( array != null ) {

Problem at line 599 character 31: Use '===' to compare with 'null'.

if ( array.length == null || typeof array === "string" ||
jQuery.isFunctio...

Problem at line 648 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 648 character 18: Confusing use of '!'.

if ( !inv !== !callback( elems[ i ], i ) ) {

Problem at line 665 character 24: Use '!==' to compare with 'null'.

if ( value != null ) {

Problem at line 713 character 4: Mixed spaces and tabs.

[];

Problem at line 823 character 21: Missing '()' invoking a constructor.

return (new Date).getTime();

Problem at line 913 character 13: 'e' is already defined.

} catch(e) {

Problem at line 1476 character 28: Expected an assignment or function
call and instead saw an expression.

parent.selectedIndex;

Problem at line 1480 character 43: Expected an assignment or function
call and instead saw an expression.

parent.parentNode.selectedIndex;

Problem at line 1592 character 55: 'eventHandle' is already defined.

eventHandle = elemData.handle, eventHandle;

Problem at line 1724 character 106: Missing semicolon.

jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\
\.)?")...

Problem at line 1748 character 25: 'j' is already defined.

for ( var j = pos || 0; j < eventType.length; j++ ) {

Problem at line 1754 character 34: Use '===' to compare with 'null'.

if ( pos == null ) {

Problem at line 1763 character 30: Use '!==' to compare with 'null'.

if ( pos != null ) {

Problem at line 1770 character 48: Use '!==' to compare with 'null'.

if ( eventType.length === 0 || pos != null && eventType.length === 1 )
{

Problem at line 1893 character 26: 'e' is already defined.

} catch (e) {}

Problem at line 1907 character 30: Bad assignment.

event = arguments[0] = jQuery.event.fix( event || window.event );

Problem at line 1919 character 20: 'events' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1919 character 60: 'handlers' is already defined.

var events = jQuery.data(this, "events"), handlers =
events[ event.type ];

Problem at line 1989 character 26: Use '===' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 1989 character 51: Use '!==' to compare with 'null'.

if ( event.pageX == null && event.clientX != null ) {

Problem at line 2275 character 19: Use '!==' to compare with 'null'.

if ( data != null || val ) {

Problem at line 2487 character 39: Use '!==' to compare with 'null'.

while ( (type = types[ i++ ]) != null ) {

Problem at line 2516 character 18: Don't make functions within a loop.

});

Problem at line 2525 character 6: Missing semicolon.

}

Problem at line 2632 character 56: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2632 character 81: Unescaped '['.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"]
[^'"]*['"]...

Problem at line 2702 character 21: 'ret' is already defined.

var ret = seed ?

Problem at line 2722 character 26: Use '===' to compare with 'null'.

if ( pop == null ) {

Problem at line 2738 character 23: 'cur' used out of scope.

Sizzle.error( cur || selector );

Problem at line 2745 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2751 character 25: 'i' is already defined.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2751 character 42: Use '!==' to compare with 'null'.

for ( var i = 0; checkSet != null; i++ ) {

Problem at line 2798 character 40: 'match' is already defined.

var type = Expr.order, match;

Problem at line 2807 character 26: Use '!==' to compare with 'null'.

if ( set != null ) {

Problem at line 2828 character 64: Use '!==' to compare with 'null'.

if ( (match = Expr.leftMatch[ type ].exec( expr )) != null &&
match[2] ) {

Problem at line 2853 character 58: Use '!==' to compare with 'null'.

for ( var i = 0; (item = curLoop) != null; i++ ) {

Problem at line 2858 character 51: Use '!==' to compare with 'null'.

if ( inplace && found != null ) {

Problem at line 2890 character 27: Use '===' to compare with 'null'.

if ( anyFound == null ) {

Problem at line 2910 character 35: Unescaped '-'.

ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2911 character 39: Unescaped '-'.

CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,

Problem at line 2912 character 48: Unescaped '-'.

NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,

Problem at line 2913 character 41: Unescaped '-'.

ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)
\3|)\s*...

Problem at line 2914 character 38: Unescaped '-'.

TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,

Problem at line 2915 character 65: Unescaped '-'.

CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,

Problem at line 2916 character 69: Unescaped '-'.

POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,

Problem at line 2917 character 39: Unescaped '-'.

PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\
(\)]*)...

Problem at line 2967 character 29: 'i' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2967 character 36: 'l' is already defined.

for ( var i = 0, l = checkSet.length; i < l; i++ ) {

Problem at line 2968 character 30: 'elem' is already defined.

var elem = checkSet;

Problem at line 2989 character 61: 'nodeCheck' used out of scope.

checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);

Problem at line 2999 character 66: 'nodeCheck' used out of scope.

checkFn("previousSibling", part, doneName, checkSet, nodeCheck,
isXML);

Problem at line 3034 character 56: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = curLoop) != null; i++ ) {

Problem at line 3120 character 29: Expected an assignment or function
call and instead saw an expression.

elem.parentNode.selectedIndex;

Problem at line 3133 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /h\d/i.test( elem.nodeName );

Problem at line 3163 character 20: Wrap the /regexp/ literal in parens
to disambiguate the slash operator.

return /input|select|textarea|button/i.test(elem.nodeName);

Problem at line 3203 character 29: 'i' is already defined.

for ( var i = 0, l = not.length; i < l; i++ ) {

Problem at line 3227 character 32: Expected a 'break' statement before
'case'.

node = elem;

Problem at line 3277 character 34: Use '!==' to compare with 'null'.

elem[ name ] != null ?

Problem at line 3284 character 27: Use '===' to compare with 'null'.

return result == null ?

Problem at line 3320 character 6: Don't make functions within a loop.

}));

Problem at line 3339 character 77: Expected an assignment or function
call and instead saw an expression.

Array.prototype.slice.call( document.documentElement.childNodes, 0 )
[0].node...

Problem at line 3354 character 29: 'i' is already defined.

for ( var i = 0; array; i++ ) {

Problem at line 3443 character 34: Missing '()' invoking a
constructor.

id = "script" + (new Date).getTime();

Problem at line 3686 character 1: Unreachable 'window' after 'return'.

window.Sizzle = Sizzle;

Problem at line 3693 character 11: 'slice' is already defined.

slice = Array.prototype.slice;

Problem at line 3699 character 20: Confusing use of '!'.

return !!qualifier.call( elem, i, elem ) === keep;

Problem at line 4114 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 4131 character 49: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = this) != null; i++ ) {

Problem at line 4320 character 9: Inner functions should be listed at
the top of the outer function.

function root( elem, cur ) {

Problem at line 4320 character 22: 'root' was used before it was
defined.

function root( elem, cur ) {

Problem at line 4424 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4492 character 25: 'i' is already defined.

for ( var i = 0; ret; i++ ) {

Problem at line 4513 character 50: Use '!==' to compare with 'null'.

for ( var i = 0, elem; (elem = elems) != null; i++ ) {

Problem at line 4628 character 13: Function statements cannot be
placed in blocks. Use a function expression or move the statement to
the top of the outer function.

function getWH() {

Problem at line 4749 character 24: 'name' is already defined.

for ( var name in options ) {

Problem at line 4868 character 24: Use '===' to compare with 'null'.

return val == null ?

Problem at line 5052 character 41: Bad operand.

if ( s.global && ! jQuery.active++ ) {

Problem at line 5238 character 17: 'e' is already defined.

} catch(e) { }

Problem at line 5253 character 17: 'e' is already defined.

} catch(e) {

Problem at line 5276 character 26: 'complete' was used before it was
defined.

function complete() {

Problem at line 5293 character 25: 'trigger' is already defined.

function trigger(type, args) {

Problem at line 5404 character 9: Inner functions should be listed at
the top of the outer function.

function buildParams( prefix, obj ) {

Problem at line 5404 character 29: 'buildParams' was used before it
was defined.

function buildParams( prefix, obj ) {

Problem at line 5423 character 45: Use '!==' to compare with 'null'.

} else if ( !traditional && obj != null && typeof obj === "object" ) {

Problem at line 5444 character 19: Unescaped '-'.

rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,

Problem at line 5531 character 24: Use '===' to compare with 'null'.

} else if ( fn == null || bool ) {

Problem at line 5589 character 31: Use '!==' to compare with 'null'.

if ( opt.overflow != null ) {

Problem at line 5744 character 35: Use '!==' to compare with 'null'.

if ( this.elem[this.prop] != null && (!this.elem.style ||
this.elem.style[t...

Problem at line 5744 character 94: Use '===' to compare with 'null'.

if ( this.elem[this.prop] != null && (!this.elem.style ||
this.elem.style[t...

Problem at line 5816 character 43: Use '!==' to compare with 'null'.

if ( this.options.display != null ) {

Problem at line 5887 character 1: Mixed spaces and tabs.

fast: 200,

Problem at line 5888 character 1: Mixed spaces and tabs.

// Default speed

Problem at line 5889 character 1: Mixed spaces and tabs.

_default: 400

Problem at line 5898 character 60: Use '!==' to compare with 'null'.

if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {

Problem at line 5915 character 15: 'genFx' was used before it was
defined.

function genFx( type, num ) {

Problem at line 6203 character 25: Use '===' to compare with 'null'.

return size == null ? null : this;
 
L

lorlarz

lorlarz wrote: [snip]

Yes, I saw those.  I'll look at them when I have a chance.  But
basically it indicates what I expected (even after all of these years,
the code is still hopelessly amateurish).  And I'm not at all surprised
that Resig is quick to dismiss the results.  That's what he does.
That's all he does.  And he absolutely will not stop until his project
is dead.  :)
I do very much value all your inputs. They are almost always helpful

NP.  Thanks for asking.  It is good to question jQuery.  If more people
would take the time to do that, perhaps it would fade away.  Take bad
logic and bad style and authors who clearly won't consider anything but
their own delusions and you've got a clear candidate for history's bit
bucket.- Hide quoted text -

- Show quoted text -

David, It my brief communication with John Resig _and_, given the
errors I
found and had to correct to get more than 41% of jQuery 1.4.2 through
JSLint, I do not believe Resig even sent jQuery 1.4.2 through JSLint.

I have emailed him. But if he looks at JSLint results, I believe it
is likely
the run results I provided may well be the first he has seen.
 
L

lorlarz

WTF?!  It could be a typo or it could just be a very bizarre construct.
 You've really got to feel for anyone who has to wade through this stuff
on a regular basis.  Perhaps that explains the snail's pace of their
"progress" over the last few years.  Who would subject themselves to
fiddling around with such nonsense?

[snip]

David,

I don't think you know how well jQuery is doing. It is by far the
most used JS library and has had and continues to have the fastest
growth. Moreover, jQuery is now used somewhere in a full 20% of
web sites on the Earth.

We must stay critical about it. But, while other libraries may be
failing, from any use standpoint, jQuery is not.
 
L

lorlarz

[snip]

For convenience, I thought it would be good to just refer to ONE file
(one document) regarding all the changes I needed to make to get
jQuery 1.4.2 all the way through JSLint **_AND_** the remaining
errors found (in particular, their line numbers) NOW referring to the
SAME jQuery 1.4.2 Development Verson (obtainable fromhttp://jquery.ocm
).

OK.  Here it is.  Directions:  Simply make the following changes to
the Development version of jQuery 1.4.2 :

2649 changed to: var origContext = context || document; // = contents
before = contents removed

lines 2663 to 2673 commented out

2985 changed to: var nodeCheck = part.toLowerCase();  // = part
before = part  removed

2995 changed to: var nodeCheck = part.toLowerCase(); // = part  before
= part  removed

3317 changed to Expr.match[ type ] = new
RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*
\))/.source) ); // parentheses added on expression after + sign

4167 commented out

4775 commented out

5994 prevOffsetParent = offsetParent; offsetParent =
elem.offsetParent; // (comma in middle changed to semi-colon)

6035 checkDiv.style.position = "fixed"; checkDiv.style.top =
"20px"; // (comma in middle changed to semi-colon)

6040 innerDiv.style.overflow = "hidden"; innerDiv.style.position =
"relative"; // (comma in middle changed to semi-colon)
[snip]

The problems I would _really_ like to see addressed are what
JSLInt saw as *big problems* and I did not correct, but rather
commented out to even get through jQuery 1.4.2 with JSLint .
Below are the 3 bits of code I had to comment out.:

The block I had to comment out: (all line no. now refer to
development
version of jQuery 1.4.2 , as provided by http://jquery.com ):

lines 2663 to 2673

/* while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
soFar = m[3];

parts.push( m[1] );

if ( m[2] ) {
extra = m[3];
break;
}
}
*/

and

line 4167:

// replace(/=([^="'>\s]+\/)>/g, '="$1">')



and

line 4775:

// jsre = /=\?(&|$)/,

How big are these problems? Can they be viewed as benign?
I sure do NOT know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top