Tab Atkins Jr. wrote:
let o = { items: function() {} }; > > would pass that test.I'm not sure how else you're supposed to detect iterables.
It's not 'items', btw. The iterator-getter/maker is named 'iterator' in SpiderMonkey currently, and last I heard would be @iterator (well-known public symbol) in ES6.
As with most duck typing, you're right and I think Rick is picking on a non-issue: there's no point worrying about the halting problem. Just call the quack function and let the chips fall where they may ;-).
/be _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

