JSLint Reports on last 2 Production Versions of jQuery

L

lorlarz

lorlarz wrote:
[snip]
2985 changed to: var nodeCheck = part.toLowerCase();  // = part
before = part  removed
2995 changed to: var nodeCheck = part.toLowerCase(); // = part  before
= part  removed

Huh?
[snip]

Here's what I mean:

There were 2 cases in which they had the following):

var nodeCheck = part = part.toLowerCase();

There where 2 other exactly similar cases other than the 2 of those.

Pretty much makes it unlikely any JSLint report was ever looked at.
 
L

lorlarz

lorlarz wrote:
[snip]

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

Huh?



[snip]

Here's what I mean:


There were 2 cases in which they had the following):
(JSLInt considered this too big a problem to continue BUT
since toLowercase() does not alter the string it is applied
to but returns a modified copy, it is possibly what is wanted.
Makes me wonder if
JSLInt is not a bit "wack" on this):


var nodeCheck = part = part.toLowerCase();


There where 2 other exactly similar cases other than the 2 of those.
 
L

lorlarz

lorlarz wrote:
[snip]
2985 changed to: var nodeCheck = part.toLowerCase();  // = part
before = part  removed
2995 changed to: var nodeCheck = part.toLowerCase(); // = part  before
= part  removed
Huh?

[snip]

Here's what I mean:

There were 2 cases in which they had the following):
(JSLInt considered this too big a problem to continue BUT
 since toLowercase() does not alter the string it is applied
 to but returns a modified copy, it is possibly what is wanted.
 Makes me wonder if
 JSLInt is not a bit "wack" on this):

var nodeCheck = part = part.toLowerCase();

There where 2 other exactly similar cases other than the 2 of those.

P.S. To my last post (sorry):

The things of concern to me among the remaining 'errors' in the
JSLint
report, these seem to be the most worrisome:

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 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 5052 character 41: Bad operand.


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

lorlarz


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 byhttp://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.- Hide quoted text -

- Show quoted text -

P.S. To my above quoted post (sorry):

The things of concern to me among the remaining 'errors' in the
JSLint
report, these seem to be the most worrisome:


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 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 5052 character 41: Bad operand.


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

Gregor Kofler

lorlarz meinte:
David,

I don't think you know how well jQuery is doing.

I'm pretty sure he knows.
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.

And? You should know by now, that there is no relation between code
quality and widespread use. (After all Internet Explorer 6 is still the
most popular browser on this planet's face...)

Zillions of web pages claim to be XHTML 1.0 strict - hardly anyone
really is. Bottom line: Most web authors are quite incompetent when it
comes to web authoring, and they are *completely* clueless when it comes
to browser scripting. Tthat's why the resort to some library or -
frequently - a bunch of them (I once had to work on a site sporting
jQuery, Spry and mootools plus "plugins" and "extensions"; it was
"leaking badly").

Gregor
 
L

lorlarz

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 byhttp://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;
                }
        }
        */

line 4167:
// replace(/=([^="'>\s]+\/)>/g, '="$1">')

line 4775:
// jsre = /=\?(&|$)/,
How big are these problems?  Can they be viewed as benign?
I sure do NOT know.- Hide quoted text -
- Show quoted text -

P.S. To my above quoted post (sorry):

The things of concern to me among the remaining 'errors' in the
JSLint
report, these seem to be the most worrisome:

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 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 5052 character 41: Bad operand.

if ( s.global && ! jQuery.active++ ) {- Hide quoted text -


I really wrongly 'fixed' lines 2985 and 2995: They should have been
fixed
to read: part = part.toLowerCase(); var nodeCheck = part;

I though this might cure the 'nodeCheck' used out of scope JSLint
error
but it did not.

Still, people should change the fix for lines 2985 and 2995 and rerun
JSLInt via http://jslint.org to see a possibly truer error list --
I.E.
since I really made a wrong 'correction' before. Also, of course,
the
three things I had to comment out to get jQuery 1.4.2 all the way
through
JSLint may have wrongfully created an error by JSLint.

This may irritate people, but after fixing my wrong fix, here is the
JSLint 'error' list (recall 3 commented out areas may still have
falsely caused problems, but at least now nothing else would do that).

UPDATE: JSLint remaining 'errors':

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 meinte:



I'm pretty sure he knows.



And? You should know by now, that there is no relation between code
quality and widespread use. (After all Internet Explorer 6 is still the
most popular browser on this planet's face...)

Zillions of web pages claim to be XHTML 1.0 strict - hardly anyone
really is. Bottom line: Most web authors are quite incompetent when it
comes to web authoring, and they are *completely* clueless when it comes
to browser scripting. Tthat's why the resort to some library or -
frequently - a bunch of them (I once had to work on a site sporting
jQuery, Spry and mootools plus "plugins" and "extensions"; it was
"leaking badly").

Gregor

--http://www.gregorkofler.com

This might make a lot of JS people here mad, but I _want_ to use
jQuery. I just want to have all assurance or reasonable
quality control. At the very least, jQuery is very close to
OK. I just really want to know if there are any _real_ errors
that make things work wrong.
 
M

Matt Kruse

This might make a lot of JS people here mad, but I _want_ to use
jQuery.   I just want to have all assurance or reasonable
quality control.  At the very least, jQuery is very close to
OK.  I just really want to know if there are any _real_ errors
that make things work wrong.

The real problems with jQuery can't be found by JSLint, because they
are logic and algorithm problems. This simply attempt to solve the
problem in the wrong way. Even if the syntax was correct and passed
JSLint 100%, the logic would still be in error.

The question of whether or not to use jQuery is a cost/benefit
analysis. Sadly, most people using it (IMO) over-estimate the benefit
and are not even capable of understanding the cost.

Which is not to say that you cannot understand each and still decide
to use jQuery. I do. In some situations, for some tasks.

Matt Kruse
 
G

Gregor Kofler

lorlarz meinte:
This might make a lot of JS people here mad, but I _want_ to use
jQuery. I just want to have all assurance or reasonable
quality control. At the very least, jQuery is very close to
OK. I just really want to know if there are any _real_ errors
that make things work wrong.

JSLint won't tell you anything about code quality. Well, at least not
much. JSLint won't tell you anything about efficiency of scripts. It
can't tell you anything about *browser* scripting (it's not interested
in host objects). It won't tell you whether the script being checked is
up to the task it was written for.

Even if scripts don't pass JSLint they can be perfectly ok (which
doesn't apply to jQuery) - one just has to understand the warnings issued.

Gregor
 
L

lorlarz

[snip]


You may be interested to know that in response to this JSLint barrage
(which I have also contacted John Resig personally about), John
has decided to make a couple of changes and is considering making
a couple (or some) others. The following links, provided by J. Resig
supposedly have something to do with 2 changes made so far:

http://github.com/jquery/jquery/commit/a18f682012ae8e63f3b43b39375b3c5ce0a561e3
http://github.com/jeresig/sizzle/commit/89dd2b35d51693f46b2043149243920b380ad474

He also said he has one thing to investigate and another he is unsure
of.
Also: It is also noteworthy that at least one of the errors cited
by JSLint was seen as a real error _needing_ fixing.

John Resig encourages people to keep up on any changes by getting
the most recent release always: http://code.jquery.com/jquery-nightly.js

I shall not pass any judgement on any of this.
 
L

lorlarz

[snip]

You may be interested to know that in response to this JSLint barrage
(which I have also contacted John Resig personally about), John
has decided to make a couple of changes and is considering making
a couple (or some) others.  The following links, provided by J. Resig
supposedly have something to do with 2 changes made so far:

http://github.com/jquery/jquery/com...g/sizzle/commit/89dd2b35d51693f46b20431492439...

He also said he has one thing to investigate and another he is unsure
of.
Also: It is also noteworthy that at least one of the errors cited
by JSLint was seen as a real error _needing_ fixing.

John Resig encourages people to keep up on any changes by getting
the most recent release always:http://code.jquery.com/jquery-nightly.js

I shall not pass any judgement on any of this.

P.S. John adds that he has also made this fix:
http://github.com/jeresig/sizzle/commit/bba54187feed83914d9a83b4b74c51168e816073

Unfortunately, he will not participate here and has basically
insisted
that these issues be discussed in the following forum:

http://forum.jquery.com/developing-jquery-core

(I did put my last big post ( http://tinyurl.com/yc6gf5m ) there,
as he seemed to request)
 
J

john

(After all Internet Explorer 6 is still the
most popular browser on this planet's face...)

according to what statistics? fortunately all of the references i looked
at (those linked from the wikipedia page on browser usage) contradict
that. checking the logs for 15 client sites (none of which are tech
oriented) i see a similar pattern of IE6 being anywhere from 3rd to 5th
most used browser.

http://marketshare.hitslink.com/browser-market-share.aspx?qprid=2
http://www.w3counter.com/globalstats.php?year=2010&month=1
http://gs.statcounter.com/#browser_version-ww-monthly-200902-201003
http://www.w3schools.com/browsers/browsers_stats.asp
<http://statowl.com/web_browser_usag...ltr_br=&fltr_os=&fltr_se=&fltr_cn=&limit[]=ie>
 
L

lorlarz

P.S.  John adds that he has also made this fix:http://github.com/jeresig/sizzle/commit/bba54187feed83914d9a83b4b74c5...

Unfortunately, he will not participate here and has basically
insisted
that these issues be discussed in the following forum:

http://forum.jquery.com/developing-jquery-core

(I did put my last big post (http://tinyurl.com/yc6gf5m) there,
as he seemed to request)- Hide quoted text -

I have changed another correction I make to make sure jQuery is
left at no wrong disadvantage. In my instructions for running
the JSLint on jQuery 1.4.2 Development version, yourself:
Change the instruction for line 2649:

NOW: 2649 is to be changed to:

context = context || document; var origContext = context;

** I reran JSLint and nothing whatsoever. **

You will have to see earlier posts in this thread for
other changes you must make to get jQuery 1.4.2 to
get all the way through JSLint.

The dialog over on http://forum.jquery.com/developing-jquery-core on
the thread "jQuery 1.4.2 : JSlint" could be interesting. Perhaps
you will want to at least view it. This is where the jQuery
community
will reapond to the JSLint results. John Resig has already
personally
responded to what he has done.
 
G

Gregor Kofler

john meinte:
(After all Internet Explorer 6 is still the
most popular browser on this planet's face...)

according to what statistics? fortunately all of the references i looked
at (those linked from the wikipedia page on browser usage) contradict
that. checking the logs for 15 client sites (none of which are tech
oriented) i see a similar pattern of IE6 being anywhere from 3rd to 5th
most used browser.

http://marketshare.hitslink.com/browser-market-share.aspx?qprid=2
http://www.w3counter.com/globalstats.php?year=2010&month=1
http://gs.statcounter.com/#browser_version-ww-monthly-200902-201003
http://www.w3schools.com/browsers/browsers_stats.asp
<http://statowl.com/web_browser_usag...ltr_br=&fltr_os=&fltr_se=&fltr_cn=&limit[]=ie>

Indeed. On statcounter it currently occupies the second place...
If you look at Europe or perhaps Germany the situation improves further.
It was just the usual reply, when someone tries to rate the "quality" of
product by its widespread use and acceptance.

Gregor
 
L

lorlarz

You may be interested to know that in response to this JSLint barrage
(which I have also contacted John Resig personally about), John
has decided to make a couple of changes and is considering making
a couple (or some) others.  The following links, provided by J. Resig
supposedly have something to do with 2 changes made so far:
[snipped mangled link]
He also said he has one thing to investigate and another he is unsure
of.
Also: It is also noteworthy that at least one of the errors cited
by JSLint was seen as a real error _needing_ fixing.

That's just a missing semicolon. It's not an "error _needing_ fixing"
(in this case), and John Resig didn't say it was. It's good style to add
the semicolon even if it's not strictly required, that's all.
Unfortunately, he will not participate here

I'm not surprised.
and has basically insisted
that these issues be discussed in the following forum:

Looks like the logical place for your report. Apparently Resig has
already fixed many of the minor issues you mentioned, and decided to
look into some others. I wouldn't worry too much if JSLint still comes
up with some "problems" after he's done; not everything it finds is
actually a problem.

JSLint has always had its little idiosyncrasies. It doesn't check
syntax, it checks code style - and in the absence of official style
guidelines (like they are used in many companies and projects), you'll
have trouble getting any two developers to agree on a single set of
rules. JSLint uses the subset of JS that Crockford has defined in his
book as the "Good Parts", and a number of other rules which he considers
important.

Unfortunately, not all of these rules make sense for everybody, and many
of them are hardcoded. The regex lints you posted are a good example:
JSLint will complain about something like /[ab-]/ ("Unescaped '-'"), but
there's nothing wrong or ambigous about it. Adding escapes where none
are necessary is, IMHO, the opposite of good style. There are many other
examples, like the inability to call functions in a line earlier than
their declaration, the inevitable warning if functions are created in a
loop, and more regex hysteria.

To the best of my knowledge, there are no alternatives to JSLint, so we
have to take the good with the annoying, or do without a lint checker.
The JQuery team has decided to go with the latter option, which is
understandable, but it made them miss some of the issues you pointed
out. Personally, I usually just roll my eyes and change a few characters
to make JSLint happy, or use a wrapper script which lets me insert
inline comments to suppress JSLint output.

So, I don't see a problem with JQuery not passing JSLint. If you trust
the JQuery developers to write the code you're using, you might as well
trust them to decide which JSLint problems are worth fixing (as long as
they're aware of them, which they now are).

Stefan

Yes, indeed it looks like it was a semicolon that really
did _not_ need to be fixed, thus I misspoke.

I appreciate your assessment of jQuery. I do have yet to
see anyone, even the biggest critics, provide any information
about anything really wrong with jQuery -- in the sense that
something does not work (and when things like that come up,
they tend to be minor an tend to be caught by the jQuery
community itself).

The ones with the incredibly negative opinions of jQuery
have not, in my view, made a case. But I will be watching.

Here are the links to changes John Resig made (since one
link was apparently mangled in an earlier post):

http://github.com/jquery/jquery/commit/a18f682012ae8e63f3b43b39375b3c5ce0a561e3
http://github.com/jeresig/sizzle/commit/89dd2b35d51693f46b2043149243920b380ad474
http://github.com/jeresig/sizzle/commit/bba54187feed83914d9a83b4b74c51168e816073
 
D

David Mark

lorlarz said:
[snip]


You may be interested to know that in response to this JSLint barrage
(which I have also contacted John Resig personally about), John
has decided to make a couple of changes and is considering making
a couple (or some) others.

Highly uninteresting as that's what he does. A couple of changes?!
He'll veto the rest as a waste of time.

He's only got 998 or so to go. :)
He also said he has one thing to investigate and another he is unsure
of.

So two more. And this will lead to another release, which will lead to
some small percentage of sites "upgrading" (and likely breaking), all
because he couldn't be bothered with QA for the first few years. Why
would anyone wait around for him to reach a suitable level of
proficiency? I don't think he'll ever get there.
Also: It is also noteworthy that at least one of the errors cited
by JSLint was seen as a real error _needing_ fixing.

I'm not shocked. They could have found it themselves. Who knows how
long it has been festering?
John Resig encourages people to keep up on any changes by getting
the most recent release always: http://code.jquery.com/jquery-nightly.js

I bet. But you can't re-download, re-test and re-deploy every freaking
day! Software is supposed to be tested by the authors _before_ it is
released.
I shall not pass any judgement on any of this.

I shall. They suck at this stuff.
 
D

David Mark

lorlarz said:
I have changed another correction I make to make sure jQuery is
left at no wrong disadvantage. In my instructions for running
the JSLint on jQuery 1.4.2 Development version, yourself:
Change the instruction for line 2649:

NOW: 2649 is to be changed to:

context = context || document; var origContext = context;

** I reran JSLint and nothing whatsoever. **

You will have to see earlier posts in this thread for
other changes you must make to get jQuery 1.4.2 to
get all the way through JSLint.

The dialog over on http://forum.jquery.com/developing-jquery-core on
the thread "jQuery 1.4.2 : JSlint" could be interesting. Perhaps
you will want to at least view it. This is where the jQuery
community
will reapond to the JSLint results. John Resig has already
personally
responded to what he has done.

I just don't care. It's 2010 and they still can't deal with basic DOM
inconsistencies in IE6 (which came out last century). These are not the
people you should look to for browser scripts. Their constant struggles
to get their 70K of BS up to par are just an irritation for those who
know they shouldn't have to struggle with something they claimed to have
mastered years ago.
 
D

David Mark

lorlarz said:
You may be interested to know that in response to this JSLint barrage
(which I have also contacted John Resig personally about), John
has decided to make a couple of changes and is considering making
a couple (or some) others. The following links, provided by J. Resig
supposedly have something to do with 2 changes made so far:
[snipped mangled link]
He also said he has one thing to investigate and another he is unsure
of.
Also: It is also noteworthy that at least one of the errors cited
by JSLint was seen as a real error _needing_ fixing.
That's just a missing semicolon. It's not an "error _needing_ fixing"
(in this case), and John Resig didn't say it was. It's good style to add
the semicolon even if it's not strictly required, that's all.
John Resig encourages people to keep up on any changes by getting
the most recent release always:http://code.jquery.com/jquery-nightly.js
I shall not pass any judgement on any of this.
P.S. John adds that he has also made this fix:
http://github.com/jeresig/sizzle/commit/bba54187feed83914d9a83b4b74c5...
Unfortunately, he will not participate here
I'm not surprised.
and has basically insisted
that these issues be discussed in the following forum:
http://forum.jquery.com/developing-jquery-core
Looks like the logical place for your report. Apparently Resig has
already fixed many of the minor issues you mentioned, and decided to
look into some others. I wouldn't worry too much if JSLint still comes
up with some "problems" after he's done; not everything it finds is
actually a problem.

JSLint has always had its little idiosyncrasies. It doesn't check
syntax, it checks code style - and in the absence of official style
guidelines (like they are used in many companies and projects), you'll
have trouble getting any two developers to agree on a single set of
rules. JSLint uses the subset of JS that Crockford has defined in his
book as the "Good Parts", and a number of other rules which he considers
important.

Unfortunately, not all of these rules make sense for everybody, and many
of them are hardcoded. The regex lints you posted are a good example:
JSLint will complain about something like /[ab-]/ ("Unescaped '-'"), but
there's nothing wrong or ambigous about it. Adding escapes where none
are necessary is, IMHO, the opposite of good style. There are many other
examples, like the inability to call functions in a line earlier than
their declaration, the inevitable warning if functions are created in a
loop, and more regex hysteria.

To the best of my knowledge, there are no alternatives to JSLint, so we
have to take the good with the annoying, or do without a lint checker.
The JQuery team has decided to go with the latter option, which is
understandable, but it made them miss some of the issues you pointed
out. Personally, I usually just roll my eyes and change a few characters
to make JSLint happy, or use a wrapper script which lets me insert
inline comments to suppress JSLint output.

So, I don't see a problem with JQuery not passing JSLint. If you trust
the JQuery developers to write the code you're using, you might as well
trust them to decide which JSLint problems are worth fixing (as long as
they're aware of them, which they now are).

Stefan

Yes, indeed it looks like it was a semicolon that really
did _not_ need to be fixed, thus I misspoke.

I appreciate your assessment of jQuery. I do have yet to
see anyone, even the biggest critics, provide any information
about anything really wrong with jQuery -- in the sense that
something does not work (and when things like that come up,
they tend to be minor an tend to be caught by the jQuery
community itself).

Then you haven't been paying attention. Not only have I pointed out a
boatload of things that don't work, but I have then documented the
futility that followed when they were informed about them (i.e. they
didn't fix the problems as they couldn't understand them).
The ones with the incredibly negative opinions of jQuery
have not, in my view, made a case. But I will be watching.

You just missed it somehow. The case was built over the course of
_years_ and it is airtight.

Here's one thing to look at:-

http://www.cinsoft.net/queries.html

Here's another:-

http://www.cinsoft.net/jquerysucks.html

Search the CLJ archive for tons more.
 
D

David Mark

lorlarz said:
This might make a lot of JS people here mad, but I _want_ to use
jQuery.

Why should anyone care if you _want_ to shoot yourself in the foot. As
noted by several people, cleaning up the syntax won't cure its real ills
(the logic) any more than cleaning up Dojo's syntax cured its problems.
It's just a first step to clear things up enough so that the real work
can begin (and history has shown that the jQuery developers are not up
to doing any real work).
I just want to have all assurance or reasonable
quality control.

Then for Christ's sake, listen to people who know better and don't use
that piece of junk. Why do you _want_ to use it? Because you see lots
of other people using it? If they all jumped off a bridge, would you
follow suit?
At the very least, jQuery is very close to
OK.

No, it isn't. You are getting hung up on the JSLint results, which is
odd as they don't indicate that all is well either.
I just really want to know if there are any _real_ errors
that make things work wrong.

There _are_ and JSLint is oblivious to them (as is John Resig).
 
L

lorlarz

I have changed another correction I make to make sure jQuery is
left at no wrong disadvantage. In my instructions for running
the JSLint on jQuery 1.4.2 Development version, yourself:
Change the instruction for line 2649:

NOW: 2649 is to be changed to:

context = context || document; var origContext = context;

** I reran JSLint and nothing whatsoever. **

You will have to see earlier posts in this thread for
other changes you must make to get jQuery 1.4.2 to
get all the way through JSLint.
[snip]

Holy crap. I have got to edit better. I am sorry.
While I may be inclined to be hopeful about
jQuery, I do not want to say something that indicates
it is anywhere close to getting a clean report on
JSLInt.
** I reran JSLint and nothing whatsoever. **

Wrong. Subject to great misinterpretation!!
What I meant was:
** I re-ran jQuery in JSLint and nothing WHATSOEVER CHANGED IN THE
REPORT ***
(i.e exactly the SAME long list of 'errors' was generated by JSLint.)

Big question is: which of these 'errors' are real errors and have
any importance. The last report of the errors reported by JSLint
are still all there (and I doubt the 3 things I had to comment
out to get JSLint to scan all the way through have anything to
do with them).

STILL, can someone simply fix the three things I had to comment out
so I can run JSLint with the complete jQuery fully intact? Please,
some regular expression guru. Help. This is a pressing need.
 

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
474,079
Messages
2,570,575
Members
47,207
Latest member
HelenaCani

Latest Threads

Top