Fix "iterator.call is not a function" error when used with prototype js.

... or any library that extends native JavaScript arrays.

Switch for/in loop with a traditional for ;; loop to enumerate through an array. This will ignore prototype's enumerable method properties.
Merge pull request #2117 from jasonwoan/play-nice-with-prototype

Fix "iterator.call is not a function" error when used with prototype js.