Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,9 @@ jQuery.sub = function() {
migrateWarn( "jQuery.sub() is deprecated" );
return jQuerySub;
};

// The number of elements contained in the matched element set
jQuery.fn.size = function() {
migrateWarn( "jQuery.fn.size is deprecated; use the length property" );
return this.length;
};
4 changes: 4 additions & 0 deletions src/traversing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
jQuery.fn.andSelf = function() {
migrateWarn( "jQuery.fn.andSelf is deprecated; use jQuery.fn.addBack" );
return jQuery.fn.addBack.apply( this, arguments );
};
8 changes: 8 additions & 0 deletions test/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,11 @@ test( "jQuery.sub() - .fn Methods", function(){
});
});
});

test( ".size", function(){
expect( 1 );

expectWarning( "size", function() {
jQuery( "<div />" ).size();
});
});
1 change: 1 addition & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<script src="manipulation.js"></script>
<script src="ajax.js"></script>
<script src="event.js"></script>
<script src="traversing.js"></script>
</head>
<body>
<div id="qunit"></div>
Expand Down
10 changes: 10 additions & 0 deletions test/traversing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

module( "traversing" );

test( ".andSelf", function(){
expect( 1 );

expectWarning( "andSelf", function() {
jQuery( "<div id='outer'><div id='inner'></div></div>").find( ".inner").andSelf();
});
});