Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Object.each doesn't address IE DontEnum bugs like Object.extend and others #2130

Closed
jdalton opened this Issue · 3 comments

3 participants

John-David Dalton Arian Stolwijk Olmo Maldonado
John-David Dalton

While your other object iterator methods handle IE's DontEnum bug Object.forEach seems to be missing support.
You can see a test case (view in IE < 9).

John-David Dalton

Copying a bit of code from Function#overloadSetter:

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 i = enumerables.length; i--;){
        key = enumerables[i];
        if (hasOwnProperty.call(object, key)) fn.call(bind, object[key], key, object);
    }
});
Arian Stolwijk
Owner

yes, for 2.0 Base there is this ticket https://github.com/mootools/Base/issues/16 already.

Olmo Maldonado ibolmo referenced this issue from a commit in ibolmo/mootools-core
Olmo Maldonado ibolmo Added enumerables iteration (from Function.overloadSetter) to
Object.forEach. Fixed #2130.

Tested:
 * with compat: IE6-9
 * without compat: IE6-9
e6f2db9
Olmo Maldonado
Owner
Olmo Maldonado ibolmo was assigned
Olmo Maldonado ibolmo closed this issue from a commit
Olmo Maldonado ibolmo Added enumerables iteration (from Function.overloadSetter) to
Object.forEach. Fixed #2130.

Tested:
 * with compat: IE6-9
 * without compat: IE6-9
e6f2db9
Olmo Maldonado ibolmo closed this in e6f2db9
Olmo Maldonado ibolmo reopened this
Olmo Maldonado ibolmo referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Olmo Maldonado ibolmo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.