jashkenas/coffee-script — Issue #1771: indexOf utility and Array comprehensions need tweaking for sparse arrays and fallbacks.
Author: jdalton
Created: 2011-10-15 00:21:17+00:00
State: open

The indexOf utility fallback doesn't follow spec enough in regards to sparse arrays.
Instead of `hasOwnProperty` the `in` operator should be used.

See [this](https://github.com/jashkenas/coffee-script/commit/2ff6c4c3fcb853acf364227e1f58cd3487bb611b#commitcomment-653149) and [this](https://github.com/jashkenas/coffee-script/commit/c1d24944dc6918ac36dff3a34e89b3130566daa0#commitcomment-653098).

Also Array comprehensions should be mod'ed to fit with this change and to align with [JavaScript 1.7](https://developer.mozilla.org/en/New_in_JavaScript_1.7#Array_comprehensions_(Merge_into_Array_comprehensions\)).