Skip to content
Permalink
Browse files

Move jQuery.sub to deprecated.js, because it is.

  • Loading branch information
dmethvin committed Jun 29, 2012
1 parent 304eebb commit 672701add1ddaf3988d84beaee6508f1e738def1
Showing with 25 additions and 21 deletions.
  1. +0 −21 src/core.js
  2. +21 −0 src/deprecated.js
  3. +4 −0 test/unit/core.js
@@ -788,27 +788,6 @@ jQuery.extend({

now: function() {
return ( new Date() ).getTime();
},

sub: function() {
function jQuerySub( selector, context ) {
return new jQuerySub.fn.init( selector, context );
}
jQuery.extend( true, jQuerySub, this );
jQuerySub.superclass = this;
jQuerySub.fn = jQuerySub.prototype = this();
jQuerySub.fn.constructor = jQuerySub;
jQuerySub.sub = this.sub;
jQuerySub.fn.init = function init( selector, context ) {
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
context = jQuerySub( context );
}

return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
};
jQuerySub.fn.init.prototype = jQuerySub.fn;
var rootjQuerySub = jQuerySub(document);
return jQuerySub;
}
});

@@ -38,4 +38,25 @@ if ( browser.webkit ) {

jQuery.browser = browser;

jQuery.sub = function() {
function jQuerySub( selector, context ) {
return new jQuerySub.fn.init( selector, context );
}
jQuery.extend( true, jQuerySub, this );
jQuerySub.superclass = this;
jQuerySub.fn = jQuerySub.prototype = this();
jQuerySub.fn.constructor = jQuerySub;
jQuerySub.sub = this.sub;
jQuerySub.fn.init = function init( selector, context ) {
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
context = jQuerySub( context );
}

return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
};
jQuerySub.fn.init.prototype = jQuerySub.fn;
var rootjQuerySub = jQuerySub(document);
return jQuerySub;
};

})();
@@ -1186,6 +1186,8 @@ test("jQuery.parseXML", 8, function(){
}
});

if ( jQuery.sub ) {

test("jQuery.sub() - Static Methods", function(){
expect(18);
var Subclass = jQuery.sub();
@@ -1307,6 +1309,8 @@ test("jQuery.sub() - .fn Methods", function(){

});

} // jQuery.sub

test("jQuery.camelCase()", function() {

var tests = {

0 comments on commit 672701a

Please sign in to comment.
You can’t perform that action at this time.