{"comment":{"url":"https://api.github.com/repos/sjrd/dotty/comments/16370646","html_url":"https://github.com/sjrd/dotty/commit/57c1b1c7fdee3129d44be8b5c3e0c4c7d7bdc373#commitcomment-16370646","id":16370646,"user":{"login":"sjrd","id":535934,"avatar_url":"https://avatars.githubusercontent.com/u/535934?v=3","gravatar_id":"","url":"https://api.github.com/users/sjrd","html_url":"https://github.com/sjrd","followers_url":"https://api.github.com/users/sjrd/followers","following_url":"https://api.github.com/users/sjrd/following{/other_user}","gists_url":"https://api.github.com/users/sjrd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjrd/subscriptions","organizations_url":"https://api.github.com/users/sjrd/orgs","repos_url":"https://api.github.com/users/sjrd/repos","events_url":"https://api.github.com/users/sjrd/events{/privacy}","received_events_url":"https://api.github.com/users/sjrd/received_events","type":"User","site_admin":false},"position":12,"line":12,"path":"src/dotty/tools/backend/sjs/JSDefinitions.scala","commit_id":"57c1b1c7fdee3129d44be8b5c3e0c4c7d7bdc373","created_at":"2016-02-27T14:26:15Z","updated_at":"2016-02-27T14:26:15Z","body":"This proves harder than expected.\r\n\r\n* At the time `ContextBase` is created, the settings have not been parsed yet, so we don't know what type of `platform` to instantiate. This is fixable, it could be a `lazy val`, but it's unclear whether `platform` will be accessed before the settings have been populated or not, and would be fragile even if it isn't.\r\n* When creating the `platform`, we don't have any `Context`, but we need one to instantiate `JSDefinitions`. Even if we used the `implicit var` trick (which I still find awful), there would be nothing to `init` it. This is fixable too: we could add an `init(ctx)` in `Platform`, and `SJSPlatform` could override it to `init` its `jsDefinitions`. But it gets uglier ..."}}