]> source.dussan.org Git - jquery.git/commitdiff
Manipulation: don't use Object.keys for consistency
authorMichał Gołębiowski <m.goleb@gmail.com>
Sun, 9 Mar 2014 22:31:59 +0000 (23:31 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Sun, 9 Mar 2014 22:31:59 +0000 (23:31 +0100)
Fixes #14659

src/manipulation.js

index ff7a0d51a4ebf67ad623bea3b92d97a735393886..31d0c4edc46bbfa70b9950a2499d07a74f2eeb28 100644 (file)
@@ -276,7 +276,7 @@ jQuery.extend({
        },
 
        cleanData: function( elems ) {
-               var data, elem, events, type, key, j,
+               var data, elem, type, key,
                        special = jQuery.event.special,
                        i = 0;
 
@@ -285,9 +285,8 @@ jQuery.extend({
                                key = elem[ data_priv.expando ];
 
                                if ( key && (data = data_priv.cache[ key ]) ) {
-                                       events = Object.keys( data.events || {} );
-                                       if ( events.length ) {
-                                               for ( j = 0; (type = events[j]) !== undefined; j++ ) {
+                                       if ( data.events ) {
+                                               for ( type in data.events ) {
                                                        if ( special[ type ] ) {
                                                                jQuery.event.remove( elem, type );