{"action":"closed","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/3440","repository_url":"https://api.github.com/repos/mishoo/UglifyJS2","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/3440/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/3440/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/3440/events","html_url":"https://github.com/mishoo/UglifyJS2/issues/3440","id":477724771,"node_id":"MDU6SXNzdWU0Nzc3MjQ3NzE=","number":3440,"title":"Used var declaration is removed with default reduce_vars=true","user":{"login":"zhongqiu123","id":15800723,"node_id":"MDQ6VXNlcjE1ODAwNzIz","avatar_url":"https://avatars0.githubusercontent.com/u/15800723?v=4","gravatar_id":"","url":"https://api.github.com/users/zhongqiu123","html_url":"https://github.com/zhongqiu123","followers_url":"https://api.github.com/users/zhongqiu123/followers","following_url":"https://api.github.com/users/zhongqiu123/following{/other_user}","gists_url":"https://api.github.com/users/zhongqiu123/gists{/gist_id}","starred_url":"https://api.github.com/users/zhongqiu123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhongqiu123/subscriptions","organizations_url":"https://api.github.com/users/zhongqiu123/orgs","repos_url":"https://api.github.com/users/zhongqiu123/repos","events_url":"https://api.github.com/users/zhongqiu123/events{/privacy}","received_events_url":"https://api.github.com/users/zhongqiu123/received_events","type":"User","site_admin":false},"labels":[{"id":12518135,"node_id":"MDU6TGFiZWwxMjUxODEzNQ==","url":"https://api.github.com/repos/mishoo/UglifyJS2/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-08-07T06:06:38Z","updated_at":"2019-10-06T02:29:13Z","closed_at":"2019-10-06T02:29:13Z","author_association":"NONE","body":"**Bug report or feature request?**\r\nbug\r\n\r\n**Uglify version (`uglifyjs -V`)**\r\nuglify-js 3.6.0\r\n\r\n**JavaScript input**\r\nUglifyJs.minify(\\`\r\nfunction xxx(module) {\r\n  function fun() {\r\n    console.log(MODE.BlockStatement === 'a');\r\n  }\r\n  var MODE = {\r\n    BlockStatement: 'BlockStatement',\r\n  };\r\n  module.exports = fun;\r\n}\r\n\\`)\r\n\r\n**The `uglifyjs` CLI command executed or `minify()` options used.**\r\nuse deafult options\r\n\r\n**JavaScript output or error produced.**\r\nfunction xxx(o){o.exports=function(){console.log(\"a\"===c.BlockStatement)}}\r\n\r\nPS: `var MODE = {\r\n    BlockStatement: 'BlockStatement',\r\n  };` was removed unexpected and result in runtime error\r\n\r\nwhile the UglifyJs output is ok with the options\r\n`{\r\n  compress: {\r\n    reduce_vars: false\r\n  }\r\n}\r\n`\r\n\r\n\r\n`function xxx(t){function o(){console.log(\"a\"===e.BlockStatement)}var e={BlockStatement:\"BlockStatement\"};t.exports=o}`"}}
{"actor":{"display_login":"alexlamsl"}}