Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Remove the deprecated andSelf in favor of addBack. Fixes #13283 #1170

Closed
wants to merge 1 commit into from

2 participants

@ruado1987

Remove andSelf in traversing.js and replace its usage with addBack in test files.

@dmethvin
Owner

We cannot remove .andSelf() yet because it hasn't been adequately deprecated. However, we could replace the uses in the unit tests as you have done here and move the line defining it to deprecated.js. Would you like to make those changes?

Can you sign our CLA at http://contribute.jquery.org/CLA/ ? I am not clear why the commit was made by a different account than yours.

@ruado1987
@dmethvin dmethvin closed this in 8bc7bde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 18, 2013
  1. patch for bug 13283

    ruavang authored
This page is out of date. Refresh to see the latest.
View
2  src/traversing.js
@@ -136,8 +136,6 @@ jQuery.fn.extend({
}
});
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
function sibling( cur, dir ) {
while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
View
2  test/unit/effects.js
@@ -1546,7 +1546,7 @@ asyncTest( "hide, fadeOut and slideUp called on element width height and width =
});
asyncTest( "Handle queue:false promises", 10, function() {
- var foo = jQuery( "#foo" ).clone().andSelf(),
+ var foo = jQuery( "#foo" ).clone().addBack(),
step = 1;
foo.animate({
View
2  test/unit/event.js
@@ -43,7 +43,7 @@ test("Handler changes and .trigger() order", function() {
path = "";
markup
- .find( "*" ).andSelf().on( "click", function( e ) {
+ .find( "*" ).addBack().on( "click", function( e ) {
path += this.nodeName.toLowerCase() + " ";
})
.filter( "b" ).on( "click", function( e ) {
View
2  test/unit/queue.js
@@ -184,7 +184,7 @@ test("clearQueue() clears the fx queue", 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;
foo.queue( function( next ) {
View
10 test/unit/traversing.js
@@ -7,7 +7,7 @@ test( "find(String)", function() {
// using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents();
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" );
deepEqual( jQuery("#qunit-fixture").find("> div").get(), q( "foo", "nothiddendiv", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest", "fx-test-group" ), "find child elements" );
deepEqual( jQuery("#qunit-fixture").find("> #foo, > #moretests").get(), q( "foo", "moretests" ), "find child elements" );
@@ -38,7 +38,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(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() {
@@ -690,3 +690,9 @@ test("index(no arg) #10977", function() {
equal( jQuery( div ).index(), 0, "If jQuery#index called on element whos parent is fragment, it still should work correctly" );
});
+
+test("drop addSelf support #13283", function() {
+ expect( 1 );
+
+ ok( typeof jQuery.fn.andSelf === "undefined", jQuery.fn.andSelf);
+});
Something went wrong with that request. Please try again.