From a96d5bed58f2b30f97d6dd2f5691cd890f62b75f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Sun, 9 Mar 2014 23:31:59 +0100 Subject: [PATCH] Manipulation: don't use Object.keys for consistency Fixes #14659 --- src/manipulation.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/manipulation.js b/src/manipulation.js index ff7a0d51a..31d0c4edc 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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 ); -- 2.39.5