mitsuhiko/templatetk — comment on commit 08e0f8d4d1614657cc3cf6aa4a23ed125ddb0f55
File: templatetk/res/templatetk.runtime.js line 162
By chrisdickinson:

Cool. If it helps it feel better in any regard, it's not just a guard against patching -- the two `for` loop constructs in JS are designed to work specifically with certain types -- and woe is certain whenever one passes the wrong type to the wrong loop construct. At the very least, modifying the `sequenceFromIterable` to be able to discern between `Array` and `Object` types is a must have -- as aforementioned, even the standard library will occasionally annotate arrays with extra fields (the `RegExp` example above), and it's handy to have the template language deal with those situations as expected.