From de30e4a73d0591127c1cfbf20867b59469b2d51f Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Fri, 13 Nov 2015 17:01:53 +0300 Subject: [PATCH] Revert "Deprecated: Drop size and andSelf methods" This reverts commit f110360f65a268e959ae892ca36e85da3d91e606. --- src/deprecated.js | 8 ++++++++ test/unit/deprecated.js | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/src/deprecated.js b/src/deprecated.js index 78885266d..dfd06826a 100644 --- a/src/deprecated.js +++ b/src/deprecated.js @@ -20,7 +20,15 @@ jQuery.fn.extend( { return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); + }, + size: function() { + return this.length; } } ); +jQuery.fn.andSelf = jQuery.fn.addBack; + } ); + + + diff --git a/test/unit/deprecated.js b/test/unit/deprecated.js index f474dc6c3..a033135bf 100644 --- a/test/unit/deprecated.js +++ b/test/unit/deprecated.js @@ -39,3 +39,9 @@ QUnit.test( "delegate/undelegate", function( assert ) { .undelegate( "b", "click" ) .remove(); } ); +if ( jQuery.fn.size ) { + test("size()", function() { + expect(1); + equal( jQuery("#qunit-fixture p").size(), 6, "Get Number of Elements Found" ); + }); +} -- 2.39.5