Skip to content

Commit de30e4a

Browse files
committed
Revert "Deprecated: Drop size and andSelf methods"
This reverts commit f110360.
1 parent ea2f10c commit de30e4a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/deprecated.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ jQuery.fn.extend( {
2020
return arguments.length === 1 ?
2121
this.off( selector, "**" ) :
2222
this.off( types, selector || "**", fn );
23+
},
24+
size: function() {
25+
return this.length;
2326
}
2427
} );
2528

29+
jQuery.fn.andSelf = jQuery.fn.addBack;
30+
2631
} );
32+
33+
34+

test/unit/deprecated.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ QUnit.test( "delegate/undelegate", function( assert ) {
3939
.undelegate( "b", "click" )
4040
.remove();
4141
} );
42+
if ( jQuery.fn.size ) {
43+
test("size()", function() {
44+
expect(1);
45+
equal( jQuery("#qunit-fixture p").size(), 6, "Get Number of Elements Found" );
46+
});
47+
}

0 commit comments

Comments
 (0)