sstephenson/prototype — pull request #82 by slusarz (2012-11-03 19:24:20+00:00)
Title: Context incorrect in IE 9 each() call

[Browser window 1]

```javascript
parent.opener.Foo.bar();
```

[browser window 2]
```javascript
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.