{"action":"created","issue":{"url":"https://api.github.com/repos/MatAtBread/acorn-es7-plugin/issues/9","repository_url":"https://api.github.com/repos/MatAtBread/acorn-es7-plugin","labels_url":"https://api.github.com/repos/MatAtBread/acorn-es7-plugin/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/MatAtBread/acorn-es7-plugin/issues/9/comments","events_url":"https://api.github.com/repos/MatAtBread/acorn-es7-plugin/issues/9/events","html_url":"https://github.com/MatAtBread/acorn-es7-plugin/issues/9","id":155387007,"number":9,"title":"Incorrect parsing of nested awaits with awaitAnywhere","user":{"login":"rksm","id":467450,"avatar_url":"https://avatars.githubusercontent.com/u/467450?v=3","gravatar_id":"","url":"https://api.github.com/users/rksm","html_url":"https://github.com/rksm","followers_url":"https://api.github.com/users/rksm/followers","following_url":"https://api.github.com/users/rksm/following{/other_user}","gists_url":"https://api.github.com/users/rksm/gists{/gist_id}","starred_url":"https://api.github.com/users/rksm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rksm/subscriptions","organizations_url":"https://api.github.com/users/rksm/orgs","repos_url":"https://api.github.com/users/rksm/repos","events_url":"https://api.github.com/users/rksm/events{/privacy}","received_events_url":"https://api.github.com/users/rksm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-17T23:40:44Z","updated_at":"2016-05-18T19:39:10Z","closed_at":"2016-05-18T14:46:27Z","body":"Test code:\r\n\r\n```js\r\nvar options = {\r\n  ecmaVersion: 7,\r\n  plugins: {asyncawait : {awaitAnywhere: true}}\r\n};\r\n\r\nacorn.parse(\"await (await foo()).bar()\", options);\r\n```\r\n\r\nExpected structure:\r\n\r\n```\r\n:Program\r\n\\-.body[0]:ExpressionStatement\r\n  \\-.body[0].expression:AwaitExpression\r\n    \\-.body[0].expression.argument:CallExpression\r\n      \\-.body[0].expression.argument.callee:MemberExpression\r\n        |-.body[0].expression.argument.callee.object:AwaitExpression\r\n        | \\-.body[0].expression.argument.callee.object.argument:CallExpression\r\n        |   \\-.body[0].expression.argument.callee.object.argument.callee:Identifier\r\n        \\-.body[0].expression.argument.callee.property:Identifier\r\n```\r\n\r\nActual structure\r\n\r\n```\r\n:Program\r\n\\-.body[0]:ExpressionStatement\r\n  \\-.body[0].expression:CallExpression\r\n    \\-.body[0].expression.callee:MemberExpression\r\n      |-.body[0].expression.callee.object:CallExpression\r\n      | |-.body[0].expression.callee.object.callee:Identifier\r\n      | \\-.body[0].expression.callee.object.arguments[0]:AwaitExpression\r\n      |   \\-.body[0].expression.callee.object.arguments[0].argument:CallExpression\r\n      |     \\-.body[0].expression.callee.object.arguments[0].argument.callee:Identifier\r\n      \\-.body[0].expression.callee.property:Identifier\r\n```\r\n\r\nIn other words the await is mistaken as callee. When stringifying the result one gets: `await(await foo()).bar();`"},"comment":{"url":"https://api.github.com/repos/MatAtBread/acorn-es7-plugin/issues/comments/220135267","html_url":"https://github.com/MatAtBread/acorn-es7-plugin/issues/9#issuecomment-220135267","issue_url":"https://api.github.com/repos/MatAtBread/acorn-es7-plugin/issues/9","id":220135267,"user":{"login":"MatAtBread","id":2789075,"avatar_url":"https://avatars.githubusercontent.com/u/2789075?v=3","gravatar_id":"","url":"https://api.github.com/users/MatAtBread","html_url":"https://github.com/MatAtBread","followers_url":"https://api.github.com/users/MatAtBread/followers","following_url":"https://api.github.com/users/MatAtBread/following{/other_user}","gists_url":"https://api.github.com/users/MatAtBread/gists{/gist_id}","starred_url":"https://api.github.com/users/MatAtBread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatAtBread/subscriptions","organizations_url":"https://api.github.com/users/MatAtBread/orgs","repos_url":"https://api.github.com/users/MatAtBread/repos","events_url":"https://api.github.com/users/MatAtBread/events{/privacy}","received_events_url":"https://api.github.com/users/MatAtBread/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T19:39:10Z","updated_at":"2016-05-18T19:39:10Z","body":"NP. Let me know if it doesn't do what you expect "}}