{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12484","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12484/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12484/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/12484/events","html_url":"https://github.com/Microsoft/TypeScript/issues/12484","id":191508971,"number":12484,"title":"Iterator in for ... of loop transpiled to use length property which is undefined","user":{"login":"jasonpang","id":1015970,"avatar_url":"https://avatars.githubusercontent.com/u/1015970?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonpang","html_url":"https://github.com/jasonpang","followers_url":"https://api.github.com/users/jasonpang/followers","following_url":"https://api.github.com/users/jasonpang/following{/other_user}","gists_url":"https://api.github.com/users/jasonpang/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonpang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonpang/subscriptions","organizations_url":"https://api.github.com/users/jasonpang/orgs","repos_url":"https://api.github.com/users/jasonpang/repos","events_url":"https://api.github.com/users/jasonpang/events{/privacy}","received_events_url":"https://api.github.com/users/jasonpang/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-24T12:30:20Z","updated_at":"2016-11-25T00:46:09Z","closed_at":"2016-11-25T00:46:09Z","body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:**  nightly (2.2.0-dev.20161118)\r\n\r\n**Chrome Version:** Stable 54.0.2840.99 (Official Build) m (64-bit) (*Revision 7eca4ce1e662f12cadaf96c30cd2335fd03e7140-refs/branch-heads/2840@{#830}*)\r\n\r\n**TypeScript Code: (relevant portion)**\r\n```ts\r\nfor (var param of iterator) {\r\n```\r\n\r\n**Transpiled ES5 JavaScript (relevant portion):**\r\n```js\r\n for (... ; _i < iterator_1.length; _i++) {\r\n                 ^^^^^^^^^^^^^^^^^\r\n                 length is undefined\r\n```\r\n\r\n**Screenshot of Transpiled ES5 Code:**\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1015970/20598496/3b1a464e-b1fe-11e6-9ea6-a492f56d10b4.png)\r\n\r\n\r\n**Expected behavior:**\r\nUsing `for (var x of iterator) { ... }` should be transpiled correctly.\r\n\r\n**Actual behavior:**\r\nThe iterator loop is transpiled to use the `length` property which appears to be undefined for the iterator.\r\n\r\n**Reproducible Project**\r\n\r\nFor some reason, GitHub isn't allowing me to upload a `.zip` file, so here's a Google Drive link to the project ZIP: https://goo.gl/xvbwHu.\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"jasonpang"}}