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

Do not redefine Array.prototype.indexOf #22

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

laurynas commented Sep 21, 2010

Seems like some browsers (like Chrome) have native indexOf method for array. Not 100% sure, but it seems that jQuery also defines it.
Native method returns -1 if not found. I had a problem with:
http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer.js
which expects to get -1. It was conflicting with stylish select.

So I added check if indexOf already defined. Also added return -1 for compatibility. I'm not sure if this method really needed if jQuery defines it.

Sorry about tab spacing, noticed only after commit.

Best wishes,
Laurynas

yehosef commented Jan 27, 2011

This is a huge problem - We spent hours and hours tracking down problems we were having in other plugins, livequery in particular which were caused by this. Please incorporate this change for the benefit of others.

@scottdarby scottdarby closed this May 20, 2011

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