]> source.dussan.org Git - jquery.git/commitdiff
Data: remove some unused code
authorTimmy Willison <timmywillisn@gmail.com>
Wed, 6 May 2015 22:28:38 +0000 (15:28 -0700)
committerTimmy Willison <timmywillisn@gmail.com>
Tue, 12 May 2015 14:09:40 +0000 (10:09 -0400)
src/data/Data.js

index 337b0456b793e43ee97d458e72ee662a9b797683..d56e378394877af0bee897484a9af4e950fb233e 100644 (file)
@@ -13,8 +13,8 @@ Data.accepts = jQuery.acceptData;
 
 Data.prototype = {
 
-       register: function( owner, initial ) {
-               var value = initial || {};
+       register: function( owner ) {
+               var value = {};
 
                // If it is a node unlikely to be stringify-ed or looped over
                // use plain assignment
@@ -33,7 +33,7 @@ Data.prototype = {
                }
                return owner[ this.expando ];
        },
-       cache: function( owner, initial ) {
+       cache: function( owner ) {
 
                // We can accept data for non-element nodes in modern browsers,
                // but we should not, see #8335.
@@ -51,7 +51,7 @@ Data.prototype = {
                }
 
                // If not, register one
-               return this.register( owner, initial );
+               return this.register( owner );
        },
        set: function( owner, data, value ) {
                var prop,
@@ -151,11 +151,6 @@ Data.prototype = {
        hasData: function( owner ) {
                var cache = owner[ this.expando ];
                return cache !== undefined && !jQuery.isEmptyObject( cache );
-       },
-       discard: function( owner ) {
-               if ( owner[ this.expando ] ) {
-                       delete owner[ this.expando ];
-               }
        }
 };