X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=faf205ccc487edea677c6e701df582aa93acc048;hb=749d41f7de7f83f0096e76ed8bf5f78cbc972e03;hp=520db45ed6cc179ba99b40d57725e3abe17ddcd9;hpb=30082d9eba66c3c919c9f8c5b97841568c443d68;p=jquery.git diff --git a/src/core.js b/src/core.js index 520db45..faf205c 100644 --- a/src/core.js +++ b/src/core.js @@ -26,9 +26,6 @@ var jQuery = function( selector, context ) { trimLeft = /^\s+/, trimRight = /\s+$/, - // Check for non-word characters - rnonword = /\W/, - // Check for digits rdigit = /\d/, @@ -932,10 +929,9 @@ jQuery.extend({ if ( length > 1 ) { resolveArray = new Array( length ); - jQuery.each( args, function( index, element, args ) { + jQuery.each( args, function( index, element ) { jQuery.when( element ).then( function( value ) { - args = arguments; - resolveArray[ index ] = args.length > 1 ? slice.call( args, 0 ) : value; + resolveArray[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value; if( ! --length ) { deferred.resolveWith( promise, resolveArray ); } @@ -961,18 +957,20 @@ jQuery.extend({ return { browser: match[1] || "", version: match[2] || "0" }; }, - subclass: function(){ + sub: function() { function jQuerySubclass( selector, context ) { return new jQuerySubclass.fn.init( selector, context ); } + jQuery.extend( true, jQuerySubclass, this ); jQuerySubclass.superclass = this; jQuerySubclass.fn = jQuerySubclass.prototype = this(); jQuerySubclass.fn.constructor = jQuerySubclass; jQuerySubclass.subclass = this.subclass; jQuerySubclass.fn.init = function init( selector, context ) { - if (context && context instanceof jQuery && !(context instanceof jQuerySubclass)){ + if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) { context = jQuerySubclass(context); } + return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass ); }; jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;