{"action":"created","issue":{"url":"https://api.github.com/repos/rollup/rollup/issues/845","repository_url":"https://api.github.com/repos/rollup/rollup","labels_url":"https://api.github.com/repos/rollup/rollup/issues/845/labels{/name}","comments_url":"https://api.github.com/repos/rollup/rollup/issues/845/comments","events_url":"https://api.github.com/repos/rollup/rollup/issues/845/events","html_url":"https://github.com/rollup/rollup/issues/845","id":170580868,"number":845,"title":"circular live bindings not working as expected?","user":{"login":"trusktr","id":297678,"avatar_url":"https://avatars.githubusercontent.com/u/297678?v=3","gravatar_id":"","url":"https://api.github.com/users/trusktr","html_url":"https://github.com/trusktr","followers_url":"https://api.github.com/users/trusktr/followers","following_url":"https://api.github.com/users/trusktr/following{/other_user}","gists_url":"https://api.github.com/users/trusktr/gists{/gist_id}","starred_url":"https://api.github.com/users/trusktr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trusktr/subscriptions","organizations_url":"https://api.github.com/users/trusktr/orgs","repos_url":"https://api.github.com/users/trusktr/repos","events_url":"https://api.github.com/users/trusktr/events{/privacy}","received_events_url":"https://api.github.com/users/trusktr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-11T06:51:43Z","updated_at":"2016-09-24T00:29:35Z","closed_at":"2016-09-18T22:02:25Z","body":"For example, [these modules](http://goo.gl/PXXBKI) work in environments implemented with Babel, but the rollup.js code fails.  Is there some way to write these circular modules so that they work in any ES2015 module environment?\r\n\r\nFor reference, the `let A = A` and `let B = B` is required in Babel environments, as [pointed out](https://github.com/meteor/meteor/issues/7621#issuecomment-238992688) by @benjamn.\r\n\r\nI'm looking for any ideas on whether there's a solution that should theoretically work in any ES6 environment, not just with Babel."},"comment":{"url":"https://api.github.com/repos/rollup/rollup/issues/comments/249332041","html_url":"https://github.com/rollup/rollup/issues/845#issuecomment-249332041","issue_url":"https://api.github.com/repos/rollup/rollup/issues/845","id":249332041,"user":{"login":"trusktr","id":297678,"avatar_url":"https://avatars.githubusercontent.com/u/297678?v=3","gravatar_id":"","url":"https://api.github.com/users/trusktr","html_url":"https://github.com/trusktr","followers_url":"https://api.github.com/users/trusktr/followers","following_url":"https://api.github.com/users/trusktr/following{/other_user}","gists_url":"https://api.github.com/users/trusktr/gists{/gist_id}","starred_url":"https://api.github.com/users/trusktr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trusktr/subscriptions","organizations_url":"https://api.github.com/users/trusktr/orgs","repos_url":"https://api.github.com/users/trusktr/repos","events_url":"https://api.github.com/users/trusktr/events{/privacy}","received_events_url":"https://api.github.com/users/trusktr/received_events","type":"User","site_admin":false},"created_at":"2016-09-24T00:29:35Z","updated_at":"2016-09-24T00:29:35Z","body":"I've made a simpler example that shows the problem. You'll get an undefined error if you try pasting the result in your console: https://goo.gl/O7FnxM\r\n\r\nThat should theoretically work in an ES2015 Module environment because the `var` statements are hoisted, and the `initA` function (which is also hoisted) is called before the `B` or `C` classes are defined so by the time when the `B` or `C` class definitions are evaluated the value of `A` should not be undefined.\r\n\r\nHowever, in the compiled result, a new variable `A$1` is created and the `A` symbol is replaced in the B and C modules, so if one of the B or C modules is evaluated first, there will be an undefined error because the `initA` function is not setting the `A$1` variable, it is setting the `A` variable."}}
{"actor":{"display_login":"trusktr"}}