{"action":"created","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/931","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/931/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/931/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/931/events","html_url":"https://github.com/mishoo/UglifyJS2/issues/931","id":128078502,"number":931,"title":"[ES6] Arrow functions error with event listeners","user":{"login":"tresdin","id":7781091,"avatar_url":"https://avatars.githubusercontent.com/u/7781091?v=3","gravatar_id":"","url":"https://api.github.com/users/tresdin","html_url":"https://github.com/tresdin","followers_url":"https://api.github.com/users/tresdin/followers","following_url":"https://api.github.com/users/tresdin/following{/other_user}","gists_url":"https://api.github.com/users/tresdin/gists{/gist_id}","starred_url":"https://api.github.com/users/tresdin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tresdin/subscriptions","organizations_url":"https://api.github.com/users/tresdin/orgs","repos_url":"https://api.github.com/users/tresdin/repos","events_url":"https://api.github.com/users/tresdin/events{/privacy}","received_events_url":"https://api.github.com/users/tresdin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-22T03:56:22Z","updated_at":"2016-01-24T20:31:34Z","closed_at":null,"body":"I've tested harmony branch with this code\r\n```\r\nUglifyJS.minify(`oninstall = event => event.waitUntil(self.skipWaiting());`,{fromString : true});\r\n//or\r\nUglifyJS.minify(`self.oninstall = event => event.waitUntil(self.skipWaiting());`,{fromString : true});\r\n```\r\nAnd here is the error:\r\n```\r\nUnexpected token: arrow (=>)\r\nError\r\n    at new JS_Parse_Error (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1778:18)\r\n    at js_error (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1786:11)\r\n    at croak (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2299:9)\r\n    at token_error (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2307:9)\r\n    at unexpected (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2313:9)\r\n    at semicolon (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2333:56)\r\n    at simple_statement (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2520:73)\r\n    at eval (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2386:19)\r\n    at eval (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2346:31)\r\n    at eval (eval at <anonymous> (/home/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:3429:23)\r\n```\r\nIt seems that arrow functions' parser fails to recognize the event listeners' pattern."},"comment":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/comments/174339072","html_url":"https://github.com/mishoo/UglifyJS2/issues/931#issuecomment-174339072","issue_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/931","id":174339072,"user":{"login":"avdg","id":212248,"avatar_url":"https://avatars.githubusercontent.com/u/212248?v=3","gravatar_id":"","url":"https://api.github.com/users/avdg","html_url":"https://github.com/avdg","followers_url":"https://api.github.com/users/avdg/followers","following_url":"https://api.github.com/users/avdg/following{/other_user}","gists_url":"https://api.github.com/users/avdg/gists{/gist_id}","starred_url":"https://api.github.com/users/avdg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avdg/subscriptions","organizations_url":"https://api.github.com/users/avdg/orgs","repos_url":"https://api.github.com/users/avdg/repos","events_url":"https://api.github.com/users/avdg/events{/privacy}","received_events_url":"https://api.github.com/users/avdg/received_events","type":"User","site_admin":false},"created_at":"2016-01-24T20:31:34Z","updated_at":"2016-01-24T20:31:34Z","body":"Stack trace:\r\n\r\n(... just reading bottom stack)\r\n- semicolon https://github.com/mishoo/UglifyJS2/blob/5e78f20f1c6ea2ff340d8e7a4f022a576d8c297e/lib/parse.js#L760\r\n- simple_statement: https://github.com/mishoo/UglifyJS2/blob/5e78f20f1c6ea2ff340d8e7a4f022a576d8c297e/lib/parse.js#L952\r\n- eval: https://github.com/mishoo/UglifyJS2/blob/5e78f20f1c6ea2ff340d8e7a4f022a576d8c297e/lib/parse.js#L818\r\n- eval: https://github.com/mishoo/UglifyJS2/blob/5e78f20f1c6ea2ff340d8e7a4f022a576d8c297e/lib/parse.js#L773\r\n- eval: https://github.com/mishoo/UglifyJS2/blob/5e78f20f1c6ea2ff340d8e7a4f022a576d8c297e/lib/parse.js#L1870"}}