{"action":"created","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1402","repository_url":"https://api.github.com/repos/mishoo/UglifyJS2","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1402/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1402/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1402/events","html_url":"https://github.com/mishoo/UglifyJS2/issues/1402","id":194696086,"number":1402,"title":"Wrong minification of ES6 destructuring expression by Harmony branch","user":{"login":"huy-nguyen","id":7352279,"avatar_url":"https://avatars.githubusercontent.com/u/7352279?v=3","gravatar_id":"","url":"https://api.github.com/users/huy-nguyen","html_url":"https://github.com/huy-nguyen","followers_url":"https://api.github.com/users/huy-nguyen/followers","following_url":"https://api.github.com/users/huy-nguyen/following{/other_user}","gists_url":"https://api.github.com/users/huy-nguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/huy-nguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huy-nguyen/subscriptions","organizations_url":"https://api.github.com/users/huy-nguyen/orgs","repos_url":"https://api.github.com/users/huy-nguyen/repos","events_url":"https://api.github.com/users/huy-nguyen/events{/privacy}","received_events_url":"https://api.github.com/users/huy-nguyen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-09T21:02:30Z","updated_at":"2016-12-09T21:39:46Z","closed_at":null,"body":"The Harmony branch (962b1f3d409934e1c1603c730d574ce56eaa2a58) of UglifyJS incorrectly rewrites assigment-destructuring statements in ES6, which causes runtime errors. I installed this branch using `npm install mishoo/UglifyJS2#962b1f3d409934e1c1603c730d574ce56eaa2a58`\r\n\r\nThe files I mentioned below are in this super simple demo gist: https://gist.github.com/huy-nguyen/f906136b7fb5b8f014de925233249ee1.\r\n\r\nThe input file is [input.js](https://gist.github.com/huy-nguyen/f906136b7fb5b8f014de925233249ee1#file-input-js). I ran the command `uglifyjs --beautify -- input.js > actual-output.js`. I expect the output to be [`expected-output.js`](https://gist.github.com/huy-nguyen/f906136b7fb5b8f014de925233249ee1#file-expected-output-js) but ended up getting what's in [`actual-output.js`](https://gist.github.com/huy-nguyen/f906136b7fb5b8f014de925233249ee1#file-actual-output-js). Running `actual-output.js` with the command `node actual-output.js`(`node` version 6.8.1) throws this error:\r\n```\r\n({\r\n^\r\nSyntaxError: Unexpected token (\r\n    at Object.exports.runInThisContext (vm.js:76:16)\r\n    at Module._compile (module.js:542:28)\r\n    at Object.Module._extensions..js (module.js:579:10)\r\n    at Module.load (module.js:487:32)\r\n    at tryModuleLoad (module.js:446:12)\r\n    at Function.Module._load (module.js:438:3)\r\n    at Module.runMain (module.js:604:10)\r\n    at run (bootstrap_node.js:394:7)\r\n    at startup (bootstrap_node.js:149:9)\r\n    at bootstrap_node.js:509:3\r\n```"},"comment":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/comments/266130772","html_url":"https://github.com/mishoo/UglifyJS2/issues/1402#issuecomment-266130772","issue_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1402","id":266130772,"user":{"login":"huy-nguyen","id":7352279,"avatar_url":"https://avatars.githubusercontent.com/u/7352279?v=3","gravatar_id":"","url":"https://api.github.com/users/huy-nguyen","html_url":"https://github.com/huy-nguyen","followers_url":"https://api.github.com/users/huy-nguyen/followers","following_url":"https://api.github.com/users/huy-nguyen/following{/other_user}","gists_url":"https://api.github.com/users/huy-nguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/huy-nguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huy-nguyen/subscriptions","organizations_url":"https://api.github.com/users/huy-nguyen/orgs","repos_url":"https://api.github.com/users/huy-nguyen/repos","events_url":"https://api.github.com/users/huy-nguyen/events{/privacy}","received_events_url":"https://api.github.com/users/huy-nguyen/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T21:39:46Z","updated_at":"2016-12-09T21:39:46Z","body":"That's a huge file! Can you give me some pointers to get started?"}}
{"actor":{"display_login":"huy-nguyen"}}