{"action":"created","issue":{"url":"https://api.github.com/repos/Polymer/polymer/issues/1040","labels_url":"https://api.github.com/repos/Polymer/polymer/issues/1040/labels{/name}","comments_url":"https://api.github.com/repos/Polymer/polymer/issues/1040/comments","events_url":"https://api.github.com/repos/Polymer/polymer/issues/1040/events","html_url":"https://github.com/Polymer/polymer/issues/1040","id":52425542,"number":1040,"title":"<template repeat> fails to iterate over custom arrays","user":{"login":"Mitranim","id":4263831,"avatar_url":"https://avatars.githubusercontent.com/u/4263831?v=3","gravatar_id":"","url":"https://api.github.com/users/Mitranim","html_url":"https://github.com/Mitranim","followers_url":"https://api.github.com/users/Mitranim/followers","following_url":"https://api.github.com/users/Mitranim/following{/other_user}","gists_url":"https://api.github.com/users/Mitranim/gists{/gist_id}","starred_url":"https://api.github.com/users/Mitranim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mitranim/subscriptions","organizations_url":"https://api.github.com/users/Mitranim/orgs","repos_url":"https://api.github.com/users/Mitranim/repos","events_url":"https://api.github.com/users/Mitranim/events{/privacy}","received_events_url":"https://api.github.com/users/Mitranim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-12-18T22:38:10Z","updated_at":"2015-01-15T19:58:26Z","closed_at":null,"body":"Example.\r\n```javascript\r\n// Custom array class\r\nfunction Collection() {\r\n  this.push.apply(this, arguments)\r\n}\r\nCollection.prototype = Object.create(Array.prototype)\r\nCollection.prototype.constructor = Collection\r\n\r\nvar myCollection = new Collection(1, 2, 3)  // → [1, 2, 3]\r\n\r\nmyCollection instanceof Array               // → true\r\n```\r\n\r\nWhen used in Polymer:\r\n```html\r\n<template repeat=\"{{num in myCollection}}\">\r\n  {{num}}\r\n</template>\r\n```\r\n\r\nProduces nothing:\r\n```html\r\n▼ <template repeat=\"{{num in myCollection}}\">\r\n     #document-fragment\r\n  </template>\r\n```\r\n\r\nCustom arrays are pretty common in model libraries, or at least in [this one](https://github.com/Mitranim/record). Polymer should be able to iterate over them."},"comment":{"url":"https://api.github.com/repos/Polymer/polymer/issues/comments/70150876","html_url":"https://github.com/Polymer/polymer/issues/1040#issuecomment-70150876","issue_url":"https://api.github.com/repos/Polymer/polymer/issues/1040","id":70150876,"user":{"login":"jmesserly","id":1081711,"avatar_url":"https://avatars.githubusercontent.com/u/1081711?v=3","gravatar_id":"","url":"https://api.github.com/users/jmesserly","html_url":"https://github.com/jmesserly","followers_url":"https://api.github.com/users/jmesserly/followers","following_url":"https://api.github.com/users/jmesserly/following{/other_user}","gists_url":"https://api.github.com/users/jmesserly/gists{/gist_id}","starred_url":"https://api.github.com/users/jmesserly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmesserly/subscriptions","organizations_url":"https://api.github.com/users/jmesserly/orgs","repos_url":"https://api.github.com/users/jmesserly/repos","events_url":"https://api.github.com/users/jmesserly/events{/privacy}","received_events_url":"https://api.github.com/users/jmesserly/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T19:58:26Z","updated_at":"2015-01-15T19:58:26Z","body":"fwiw, ES6 supports subclassing builtins: https://github.com/lukehoban/es6features#subclassable-built-ins\r\n... so it seems like there should be some way to do this in ES6? Maybe Array.isArray will return true for those objects?"}}