More changes to get jQuery in line with JSLint.

This commit is contained in:
jeresig 2010-03-01 21:24:49 -05:00
parent 8c8f685a91
commit dcf0fa5048
9 changed files with 195 additions and 190 deletions

View file

@ -18,7 +18,7 @@ var jQuery = function( selector, context ) {
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w\-]+)$/,
// Is it a simple selector
isSimple = /^.[^:#\[\.,]*$/,
@ -623,12 +623,14 @@ jQuery.extend({
},
grep: function( elems, callback, inv ) {
var ret = [];
var ret = [], retVal;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems.length; i < length; i++ ) {
if ( !inv !== !callback( elems[ i ], i ) ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
@ -748,7 +750,7 @@ function doScrollCheck() {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch( error ) {
} catch(e) {
setTimeout( doScrollCheck, 1 );
return;
}