{"action":"created","issue":{"url":"https://api.github.com/repos/6to5/6to5/issues/515","labels_url":"https://api.github.com/repos/6to5/6to5/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/6to5/6to5/issues/515/comments","events_url":"https://api.github.com/repos/6to5/6to5/issues/515/events","html_url":"https://github.com/6to5/6to5/issues/515","id":54587153,"number":515,"title":"Let statement name collision with variables that end in a number","user":{"login":"Ezward","id":1163329,"avatar_url":"https://avatars.githubusercontent.com/u/1163329?v=3","gravatar_id":"","url":"https://api.github.com/users/Ezward","html_url":"https://github.com/Ezward","followers_url":"https://api.github.com/users/Ezward/followers","following_url":"https://api.github.com/users/Ezward/following{/other_user}","gists_url":"https://api.github.com/users/Ezward/gists{/gist_id}","starred_url":"https://api.github.com/users/Ezward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ezward/subscriptions","organizations_url":"https://api.github.com/users/Ezward/orgs","repos_url":"https://api.github.com/users/Ezward/repos","events_url":"https://api.github.com/users/Ezward/events{/privacy}","received_events_url":"https://api.github.com/users/Ezward/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/6to5/6to5/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/6to5/6to5/labels/transformation","name":"transformation","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-16T15:26:03Z","updated_at":"2015-01-18T03:56:43Z","closed_at":"2015-01-17T15:36:41Z","body":"Certain naming patterns can trick the compiler into generating name collision.  In the example below, the innermost if generates code for let a1 that collides with the let a12 that is declared before the if; both let statements generate _a12 as the var name.\r\n\r\nHere is the es6;\r\n```\r\nfunction foo() {\r\n    var a1 = 1;\r\n    var a12 = 12;\r\n    if(a) {\r\n        let a1 = 2;\r\n        let a12 = 22;\r\n        if(a) {\r\n            let a1 = 3;\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nHere is the generated es5;\r\n```\r\n\"use strict\";\r\n\r\nfunction foo() {\r\n    var a1 = 1;\r\n    var a12 = 12;\r\n    if (a) {\r\n        var _a1 = 2;\r\n        var _a12 = 22;\r\n        if (a) {\r\n            var _a12 = 3;\r\n        }\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/6to5/6to5/issues/comments/70395596","html_url":"https://github.com/6to5/6to5/issues/515#issuecomment-70395596","issue_url":"https://api.github.com/repos/6to5/6to5/issues/515","id":70395596,"user":{"login":"Ezward","id":1163329,"avatar_url":"https://avatars.githubusercontent.com/u/1163329?v=3","gravatar_id":"","url":"https://api.github.com/users/Ezward","html_url":"https://github.com/Ezward","followers_url":"https://api.github.com/users/Ezward/followers","following_url":"https://api.github.com/users/Ezward/following{/other_user}","gists_url":"https://api.github.com/users/Ezward/gists{/gist_id}","starred_url":"https://api.github.com/users/Ezward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ezward/subscriptions","organizations_url":"https://api.github.com/users/Ezward/orgs","repos_url":"https://api.github.com/users/Ezward/repos","events_url":"https://api.github.com/users/Ezward/events{/privacy}","received_events_url":"https://api.github.com/users/Ezward/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T03:56:43Z","updated_at":"2015-01-18T03:56:43Z","body":"That was fast!"}}