{"action":"created","issue":{"url":"https://api.github.com/repos/alekseykulikov/babel-preset-es2015-node5/issues/8","labels_url":"https://api.github.com/repos/alekseykulikov/babel-preset-es2015-node5/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/alekseykulikov/babel-preset-es2015-node5/issues/8/comments","events_url":"https://api.github.com/repos/alekseykulikov/babel-preset-es2015-node5/issues/8/events","html_url":"https://github.com/alekseykulikov/babel-preset-es2015-node5/issues/8","id":127423589,"number":8,"title":"Include babel-plugin-transform-es2015-block-scoping","user":{"login":"phpnode","id":363611,"avatar_url":"https://avatars.githubusercontent.com/u/363611?v=3","gravatar_id":"","url":"https://api.github.com/users/phpnode","html_url":"https://github.com/phpnode","followers_url":"https://api.github.com/users/phpnode/followers","following_url":"https://api.github.com/users/phpnode/following{/other_user}","gists_url":"https://api.github.com/users/phpnode/gists{/gist_id}","starred_url":"https://api.github.com/users/phpnode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpnode/subscriptions","organizations_url":"https://api.github.com/users/phpnode/orgs","repos_url":"https://api.github.com/users/phpnode/repos","events_url":"https://api.github.com/users/phpnode/events{/privacy}","received_events_url":"https://api.github.com/users/phpnode/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-19T11:19:27Z","updated_at":"2016-01-19T11:37:27Z","closed_at":null,"body":"The V8 in node 5 does not support ES2015 compatible block scoping for let and const. \r\n\r\nFor example, in node 5.2, this input:\r\n```js\r\nconst a = {a: 'b', c: 'd', e: 'f'}\r\nfor (const key in a) { console.log(key, a[key]); }\r\n```\r\n\r\nproduces this output:\r\n```\r\na b\r\na b\r\na b\r\n```\r\n\r\nWhereas according to the spec it should output:\r\n```\r\na b\r\nc d\r\ne f\r\n```\r\n\r\nThis is fixed by including `babel-plugin-transform-es2015-block-scoping` in the preset."},"comment":{"url":"https://api.github.com/repos/alekseykulikov/babel-preset-es2015-node5/issues/comments/172824940","html_url":"https://github.com/alekseykulikov/babel-preset-es2015-node5/issues/8#issuecomment-172824940","issue_url":"https://api.github.com/repos/alekseykulikov/babel-preset-es2015-node5/issues/8","id":172824940,"user":{"login":"phpnode","id":363611,"avatar_url":"https://avatars.githubusercontent.com/u/363611?v=3","gravatar_id":"","url":"https://api.github.com/users/phpnode","html_url":"https://github.com/phpnode","followers_url":"https://api.github.com/users/phpnode/followers","following_url":"https://api.github.com/users/phpnode/following{/other_user}","gists_url":"https://api.github.com/users/phpnode/gists{/gist_id}","starred_url":"https://api.github.com/users/phpnode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpnode/subscriptions","organizations_url":"https://api.github.com/users/phpnode/orgs","repos_url":"https://api.github.com/users/phpnode/repos","events_url":"https://api.github.com/users/phpnode/events{/privacy}","received_events_url":"https://api.github.com/users/phpnode/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T11:37:27Z","updated_at":"2016-01-19T11:37:27Z","body":"I also tend to use `let` in this scenario but `const` is technically more appropriate - the only time you *need* to use `let` here is when you're doing a real for loop. `for in` and `for of` support const.\r\n\r\nPerhaps it's a good idea to leave `babel-plugin-transform-es2015-block-scoping` enabled anyway, because performance of `var` is quite a lot better than `let` and `const` in current V8s."}}