Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE8 failure (lack of Array.prototype.forEach) #63

Open
danielmohacsi opened this issue Feb 26, 2015 · 3 comments
Open

IE8 failure (lack of Array.prototype.forEach) #63

danielmohacsi opened this issue Feb 26, 2015 · 3 comments

Comments

@danielmohacsi
Copy link

It seems that the add method fails in ie8. The reason is that this function calls a forEach on the dep variable. IE8 does not support the Array.prototype.forEach iterator.

I have a workaround for it, using node's forEach implementation to provide an Array.prototype.forEach method, but it's not nice. It would be better if orchestrator used node's forEach implementation by default.

@yocontra
Copy link
Contributor

Use es5-shim

@rgabo
Copy link

rgabo commented Mar 1, 2015

@contra thanks for the follow up. We're third-party javascript library, integrated into the messiest websites that you can imagine. Changing/polluting the global scope, especially prototypes is super dangerous because we can break past and future functionality of our customers. So we try to be super defensive and conservative about it.

As such, es5-shim is not an option, but providing the missing forEach implementation temporarily while orchestrator relies on it does fix the issue. We restore whatever Array.prototype.forEach was before we set it.

If we were to send you a PR that avoids the native Array.prototype.forEach, would you consider merging it? We'll maintain the fork otherwise.

Thanks!

@yocontra
Copy link
Contributor

yocontra commented Mar 1, 2015

@rgabo Generally you will find it hard to get a project maintainer to consider that. We don't usually write stuff for ES3 anymore, most people have already moved on to ES6. Maybe rob would consider using _.forEach would be reasonable because that provides more than just backwards compat, it's actually faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants