Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Protect 'contains' method in Array prototype #2654
Firefox 35 includes support for the 'contains' method of ECMA 7. This breaks MooTools because it is not a protected method. Unfortunately a lot of sites are going to be broken by this, I've already tested a few including my own and jsfiddle. The specific error I see is that the Elements class does not implement the 'contains' method from the Array prototype. I've added this small change to my site and it fixes the problem.
added a commit
this pull request
Sep 25, 2014
The problem isn't with the method itself, it's that when implement(Array.prototype) is called, the contains method isn't implemented. Then when my site calls contains(or include, which calls contains) on an Elements object, an error is throws saying that the contains method doesn't exist.
I'm trying to reproduce this error but Firefox 35 isn't giving me any errors with or without this patch. Could you give me a test case? I've tried