{"action":"created","issue":{"url":"https://api.github.com/repos/leebyron/async-to-gen/issues/10","repository_url":"https://api.github.com/repos/leebyron/async-to-gen","labels_url":"https://api.github.com/repos/leebyron/async-to-gen/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/leebyron/async-to-gen/issues/10/comments","events_url":"https://api.github.com/repos/leebyron/async-to-gen/issues/10/events","html_url":"https://github.com/leebyron/async-to-gen/issues/10","id":170997561,"number":10,"title":"SyntaxError: Unexpected identifier yield","user":{"login":"ilkkao","id":474587,"avatar_url":"https://avatars.githubusercontent.com/u/474587?v=3","gravatar_id":"","url":"https://api.github.com/users/ilkkao","html_url":"https://github.com/ilkkao","followers_url":"https://api.github.com/users/ilkkao/followers","following_url":"https://api.github.com/users/ilkkao/following{/other_user}","gists_url":"https://api.github.com/users/ilkkao/gists{/gist_id}","starred_url":"https://api.github.com/users/ilkkao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilkkao/subscriptions","organizations_url":"https://api.github.com/users/ilkkao/orgs","repos_url":"https://api.github.com/users/ilkkao/repos","events_url":"https://api.github.com/users/ilkkao/events{/privacy}","received_events_url":"https://api.github.com/users/ilkkao/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-08-13T07:23:50Z","updated_at":"2016-09-11T19:31:37Z","closed_at":"2016-08-13T17:52:50Z","body":"This snippet works on Chrome 54 with native async/await \r\n\r\n```\r\nasync function test() {\r\n    return !!await console.log('works');\r\n}\r\n\r\ntest();\r\n```\r\n\r\nWith `async-to-gen` it leads to parse error. Simple workaround is to write `return !!(await ....)` instead."},"comment":{"url":"https://api.github.com/repos/leebyron/async-to-gen/issues/comments/246199326","html_url":"https://github.com/leebyron/async-to-gen/issues/10#issuecomment-246199326","issue_url":"https://api.github.com/repos/leebyron/async-to-gen/issues/10","id":246199326,"user":{"login":"leebyron","id":50130,"avatar_url":"https://avatars.githubusercontent.com/u/50130?v=3","gravatar_id":"","url":"https://api.github.com/users/leebyron","html_url":"https://github.com/leebyron","followers_url":"https://api.github.com/users/leebyron/followers","following_url":"https://api.github.com/users/leebyron/following{/other_user}","gists_url":"https://api.github.com/users/leebyron/gists{/gist_id}","starred_url":"https://api.github.com/users/leebyron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leebyron/subscriptions","organizations_url":"https://api.github.com/users/leebyron/orgs","repos_url":"https://api.github.com/users/leebyron/repos","events_url":"https://api.github.com/users/leebyron/events{/privacy}","received_events_url":"https://api.github.com/users/leebyron/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T19:31:37Z","updated_at":"2016-09-11T19:31:37Z","body":"Imagine the opposite interpretation for a different scenario, like registering a username during login:\r\n\r\n`let msg = await isAvailable(username) ? \"It's all yours!\" : \"Sorry, not available\"`\r\n\r\nYou can see how the tighter binding of await to only the condition in the ternary would be the right thing, otherwise the bug would be to think all usernames were available if isAvailable() returns a promise. "}}
{"actor":{"display_login":"leebyron"}}