{"action":"opened","issue":{"url":"https://api.github.com/repos/Rich-Harris/buble/issues/144","repository_url":"https://api.github.com/repos/Rich-Harris/buble","labels_url":"https://api.github.com/repos/Rich-Harris/buble/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/Rich-Harris/buble/issues/144/comments","events_url":"https://api.github.com/repos/Rich-Harris/buble/issues/144/events","html_url":"https://github.com/Rich-Harris/buble/issues/144","id":342067246,"node_id":"MDU6SXNzdWUzNDIwNjcyNDY=","number":144,"title":"IE11 does not support const in for..in","user":{"login":"tschaub","id":41094,"node_id":"MDQ6VXNlcjQxMDk0","avatar_url":"https://avatars0.githubusercontent.com/u/41094?v=4","gravatar_id":"","url":"https://api.github.com/users/tschaub","html_url":"https://github.com/tschaub","followers_url":"https://api.github.com/users/tschaub/followers","following_url":"https://api.github.com/users/tschaub/following{/other_user}","gists_url":"https://api.github.com/users/tschaub/gists{/gist_id}","starred_url":"https://api.github.com/users/tschaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschaub/subscriptions","organizations_url":"https://api.github.com/users/tschaub/orgs","repos_url":"https://api.github.com/users/tschaub/repos","events_url":"https://api.github.com/users/tschaub/events{/privacy}","received_events_url":"https://api.github.com/users/tschaub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-17T20:12:41Z","updated_at":"2018-07-17T20:12:41Z","closed_at":null,"author_association":"NONE","body":"Unfortunately, IE 11 does not support `const` (or `let`) in `for..in` loops (see See \r\n the [kangax compat table](http://kangax.github.io/compat-table/es6/#test-const_for-in_loop_iteration_scope)).  With buble, `const` is not transformed to `var` for `--target ie:11`.  So this kind of code breaks:\r\n```\r\n$ echo 'for (const foo in bar) {}' > input.js\r\n$ npx buble input.js --target ie:11\r\nfor (const foo in bar) {}\r\n```\r\n\r\nThe most conservative change would be to flip the `letConst` bit for IE 11.  For example:\r\n```diff\r\ndiff --git a/src/support.js b/src/support.js\r\nindex 2183032..7076329 100644\r\n--- a/src/support.js\r\n+++ b/src/support.js\r\n@@ -46,7 +46,7 @@ export const matrix = {\r\n                     8: 0b00000000000000000000,\r\n                     9: 0b01000000000000000000,\r\n                    10: 0b01000000000000000000,\r\n-                   11: 0b01000000000100000000\r\n+                   11: 0b01000000000000000000 // no let/const in for loops\r\n        },\r\n        edge: {\r\n                    12: 0b01001010100101001101,\r\n```\r\n\r\nI'd be happy to propose a PR if this or another solution would be accepted.\r\n"}}
{"actor":{"display_login":"tschaub"}}