Permalink
Browse files

Added enumerables iteration (from Function.overloadSetter) to

Object.forEach. Fixed #2130.

Tested:
 * with compat: IE6-9
 * without compat: IE6-9
  • Loading branch information...
1 parent 094428d commit e6f2db97e5c50ea15a694cfbe5f3f86c78c97176 @ibolmo committed Nov 22, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 Source/Core/Core.js
View
@@ -300,6 +300,10 @@ Object.extend('forEach', function(object, fn, bind){
for (var key in object){
if (hasOwnProperty.call(object, key)) fn.call(bind, object[key], key, object);
}
+ if (enumerables) for (var key, i = enumerables.length; i--;){
+ key = enumerables[i];
+ if (hasOwnProperty.call(object, key)) fn.call(bind, object[key], key, object);
+ }
});
Object.each = Object.forEach;

0 comments on commit e6f2db9

Please sign in to comment.