Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Context incorrect in IE 9 each() call #82

wants to merge 2 commits into


None yet
2 participants

slusarz commented Nov 3, 2012

[Browser window 1]


[browser window 2]

var Foo {
  variable: 1,

  bar: function()
    [ 1 ].each(function() {
      if (!this.variable) {
        // This code is incorrectly reached: this.variable should exist
    }, this);

Inside of the each() method, this is NOT the Foo object - it is instead the window DOM object (not sure if it is the window DOM object of window 1 or 2, but it doesn't really matter).

The hotfix is to not use the native forEach method in IE and instead use the prototypejs version.


savetheclocktower commented Dec 28, 2012

Are you sure this is happening in IE9? I can't reproduce it.

Here's my test case. For both the frame/top context and the opener/opened context, this.variable correctly gets logged as 9. Can you run this test case and tell me if you get a different result?

Tested with Internet Explorer 9.0.8112.16421 on Windows 7.

@duritong duritong pushed a commit to duritong/horde that referenced this pull request Sep 21, 2014

@slusarz slusarz Hotfix for IE 9 issue
Prevents popup IMP dynamic message page from working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment