{"issue":{"created_at":"2011-11-23T07:14:07Z","state":"closed","updated_at":"2011-12-02T09:34:20Z","comments":2,"user":{"gravatar_id":"623a36d98c105a5c083f016c5f091385","id":233918,"url":"https://api.github.com/users/yyfrankyy","avatar_url":"https://secure.gravatar.com/avatar/623a36d98c105a5c083f016c5f091385?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"yyfrankyy"},"body":"I just found out that `uglifyjs` did not handle well when there were a variable and a label with the same name, \r\n\r\nsource:\r\n\r\n    function foo() {\r\n      console.log(bar.bar);\r\n      bar: {\r\n           console.log('h');\r\n           break bar\r\n      }\r\n    }\r\n    var bar = {bar: 1};\r\n    foo();\r\n\r\ncompress to:\r\n\r\n    function foo(){console.log(a.bar);a:{console.log(\"h\");break a}}var bar={bar:1};foo();\r\n\r\nbeautify: \r\n\r\n    function foo() {\r\n        console.log(a.bar);\r\n        a : {\r\n            console.log(\"h\");\r\n            break a;\r\n        }\r\n    }\r\n\r\n    var bar = {\r\n        bar: 1\r\n    };\r\n\r\n    foo();\r\n\r\nso when I ran this compressed file, `a is not defined`\r\n\r\nI do not meant to use label in my code, however, `closure compiler`(old version) use `function inlining`, which transformed inline function with recursion inside into label, so when I compressed the code which had been compressed once by `closure compiler`, this problem occurred.\r\n\r\nbtw, I found the same problem in latest version of `closure compiler`.","assignee":null,"number":256,"id":2327215,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"problem in compressing label","closed_at":"2011-12-02T09:34:20Z","html_url":"https://github.com/mishoo/UglifyJS/issues/256","url":"https://api.github.com/repos/mishoo/UglifyJS/issues/256","milestone":null},"action":"closed"}