prototypejs / prototype

Prototype JavaScript framework
http://prototypejs.org/
Other
3.53k stars 639 forks source link

Native Array.prototype.filter is overwritten by prototype #337

Closed welluh closed 6 years ago

welluh commented 6 years ago

I'm using Magento 1.9.3 with PrototypeJS version 1.7. which defines an Enumerable::findAll and the Enumerable methods are mixed in with Array.prototype, but fails to check if Array.prototype.filter already exists.

In the documentation here it states that native method will not be overwritten.

The real issue here is that Enumerable::findAll doesn't support third argument to the callback function of Array.prototype.filter().

Hope this issue could be fixed.

Kind regards, -welluh-

savetheclocktower commented 6 years ago

Update to 1.7.3 to get this fix. Thanks!