baconjs / bacon.js

Functional reactive programming library for TypeScript and JavaScript
https://baconjs.github.io
MIT License
6.47k stars 330 forks source link

`combine` (and many other things) throws error when Array.prototype has extra methods #321

Closed stephenjudkins closed 10 years ago

stephenjudkins commented 10 years ago

To reproduce:

Array.prototype.foo = "bar"
Bacon.once("a").combine(Bacon.once("b"), (a,b) -> [a,b]).onValue ->

Will throw Uncaught TypeError: Object bar has no method 'internalDeps'

stephenjudkins commented 10 years ago

Fixed in https://github.com/baconjs/bacon.js/pull/322. Let me know your thoughts.

As always, thanks for the great library!

raimohanska commented 10 years ago

Thanks for the find and the fix!

I changed the code to use for x in xs where applicable to remove dependency on Array.prototype.forEach which isn't available on IE6. The fix is in master now. Please let me know if this is ok.

raimohanska commented 10 years ago

This is a duplicate to #320, right?

stephenjudkins commented 10 years ago

Sorry about the multiple issues, I must have had a brain fart. Yes, changing it from Array.forEach is of course just fine. And, thanks for getting a new release out the door so quickly!