Commit 8bc7bdeb authored by Nguyen Phuc Lam's avatar Nguyen Phuc Lam Committed by Dave Methvin

Ref #13283, move .andSelf() to deprecated.js. Close gh-1170.

parent 85f1985f
...@@ -161,3 +161,4 @@ Danil Somsikov <danilasomsikov@gmail.com> ...@@ -161,3 +161,4 @@ Danil Somsikov <danilasomsikov@gmail.com>
Jean Boussier <jean.boussier@gmail.com> Jean Boussier <jean.boussier@gmail.com>
Adam Coulombe <me@adam.co> Adam Coulombe <me@adam.co>
Andrew Plummer <plummer.andrew@gmail.com> Andrew Plummer <plummer.andrew@gmail.com>
Nguyen Phuc Lam <ruado1987@gmail.com>
// Limit scope pollution from any deprecated API // Limit scope pollution from any deprecated API
// (function() { // (function() {
jQuery.fn.andSelf = jQuery.fn.addBack;
// })(); // })();
...@@ -136,8 +136,6 @@ jQuery.fn.extend({ ...@@ -136,8 +136,6 @@ jQuery.fn.extend({
} }
}); });
jQuery.fn.andSelf = jQuery.fn.addBack;
function sibling( cur, dir ) { function sibling( cur, dir ) {
while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
......
...@@ -1557,7 +1557,7 @@ asyncTest( "hide, fadeOut and slideUp called on element width height and width = ...@@ -1557,7 +1557,7 @@ asyncTest( "hide, fadeOut and slideUp called on element width height and width =
}); });
asyncTest( "Handle queue:false promises", 10, function() { asyncTest( "Handle queue:false promises", 10, function() {
var foo = jQuery( "#foo" ).clone().andSelf(), var foo = jQuery( "#foo" ).clone().addBack(),
step = 1; step = 1;
foo.animate({ foo.animate({
......
...@@ -43,7 +43,7 @@ test("Handler changes and .trigger() order", function() { ...@@ -43,7 +43,7 @@ test("Handler changes and .trigger() order", function() {
path = ""; path = "";
markup markup
.find( "*" ).andSelf().on( "click", function( e ) { .find( "*" ).addBack().on( "click", function( e ) {
path += this.nodeName.toLowerCase() + " "; path += this.nodeName.toLowerCase() + " ";
}) })
.filter( "b" ).on( "click", function( e ) { .filter( "b" ).on( "click", function( e ) {
......
...@@ -184,7 +184,7 @@ test("clearQueue() clears the fx queue", function() { ...@@ -184,7 +184,7 @@ test("clearQueue() clears the fx queue", function() {
}); });
asyncTest( "fn.promise() - called when fx queue is empty", 3, function() { asyncTest( "fn.promise() - called when fx queue is empty", 3, function() {
var foo = jQuery( "#foo" ).clone().andSelf(), var foo = jQuery( "#foo" ).clone().addBack(),
promised = false; promised = false;
foo.queue( function( next ) { foo.queue( function( next ) {
......
...@@ -10,7 +10,7 @@ test( "find(String) under non-elements", function() { ...@@ -10,7 +10,7 @@ test( "find(String) under non-elements", function() {
var j = jQuery("#nonnodes").contents(); var j = jQuery("#nonnodes").contents();
equal( j.find("div").length, 0, "Check node,textnode,comment to find zero divs" ); equal( j.find("div").length, 0, "Check node,textnode,comment to find zero divs" );
equal( j.find("div").andSelf().length, 3, "Check node,textnode,comment to find zero divs, but preserves pushStack" ); equal( j.find("div").addBack().length, 3, "Check node,textnode,comment to find zero divs, but preserves pushStack" );
}); });
test( "find(leading combinator)", function() { test( "find(leading combinator)", function() {
...@@ -45,7 +45,7 @@ test( "find(node|jQuery object)", function() { ...@@ -45,7 +45,7 @@ test( "find(node|jQuery object)", function() {
equal( $two.find( $first ).length, 0, "first is in the collection and not within two" ); equal( $two.find( $first ).length, 0, "first is in the collection and not within two" );
equal( $two.find( $first ).length, 0, "first is in the collection and not within two(node)" ); equal( $two.find( $first ).length, 0, "first is in the collection and not within two(node)" );
equal( $two.find( $foo[ 0 ] ).andSelf().length, 2, "find preserves the pushStack, see #12009" ); equal( $two.find( $foo[ 0 ] ).addBack().length, 2, "find preserves the pushStack, see #12009" );
}); });
test("is(String|undefined)", function() { test("is(String|undefined)", function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment