{"action":"opened","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2606","repository_url":"https://api.github.com/repos/mishoo/UglifyJS2","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2606/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2606/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2606/events","html_url":"https://github.com/mishoo/UglifyJS2/issues/2606","id":282650104,"number":2606,"title":"[ES6] [ES8] bug: `export default` of anonymous generators and async functions","user":{"login":"kzc","id":11593452,"avatar_url":"https://avatars3.githubusercontent.com/u/11593452?v=4","gravatar_id":"","url":"https://api.github.com/users/kzc","html_url":"https://github.com/kzc","followers_url":"https://api.github.com/users/kzc/followers","following_url":"https://api.github.com/users/kzc/following{/other_user}","gists_url":"https://api.github.com/users/kzc/gists{/gist_id}","starred_url":"https://api.github.com/users/kzc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kzc/subscriptions","organizations_url":"https://api.github.com/users/kzc/orgs","repos_url":"https://api.github.com/users/kzc/repos","events_url":"https://api.github.com/users/kzc/events{/privacy}","received_events_url":"https://api.github.com/users/kzc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-16T20:57:02Z","updated_at":"2017-12-16T20:57:02Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Bug report or feature request?** \r\n\r\nbug\r\n\r\n**ES5 or ES6+ input?** \r\n\r\nES6+\r\n\r\n**Uglify version (`uglifyjs -V`)**\r\n\r\nuglify-es 3.2.2\r\n\r\n**JavaScript input**\r\n\r\n```js\r\n$ echo 'export default function* f(){};' | bin/uglifyjs \r\nexport default function*f(){};\r\n\r\n$ echo 'export default function*(){};' | bin/uglifyjs \r\nParse error at 0:1,24\r\nexport default function*(){};\r\n                        ^\r\nERROR: Unexpected token: punc (()\r\n```\r\n```js\r\n$ echo 'export default async function f(){};' | bin/uglifyjs \r\nexport default async function f(){};\r\n\r\n$ echo 'export default async function(){};' | bin/uglifyjs \r\nParse error at 0:1,29\r\nexport default async function(){};\r\n                             ^\r\nERROR: Unexpected token: punc (()\r\n```\r\nNote 1: the default export of a regular anonymous function is handled correctly:\r\n```js\r\n$ echo 'export default function(){};' | bin/uglifyjs \r\nexport default function(){};\r\n```\r\nNote 2: non-default exports of anonymous functions/classes *should* fail:\r\n```\r\n$ echo 'export function(){};' | node_modules/.bin/acorn --module --ecma2018\r\nUnexpected token (1:15)\r\n\r\n$ echo 'export async function(){};' | node_modules/.bin/acorn --module --ecma2018\r\nUnexpected token (1:21)\r\n\r\n$ echo 'export function*(){};' | node_modules/.bin/acorn --module --ecma2018\r\nUnexpected token (1:16)\r\n\r\n$ echo 'export class{}' | node_modules/.bin/acorn --module\r\nUnexpected token (1:12)\r\n```\r\n`uglify-es@3.2.2` also correctly fails the non-default exports of anonymous functions/classes above. We probably should add mocha tests for these cases."}}
{"actor":{"display_login":"kzc"}}