{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4424","repository_url":"https://api.github.com/repos/jashkenas/coffeescript","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4424/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4424/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4424/events","html_url":"https://github.com/jashkenas/coffeescript/pull/4424","id":201942369,"number":4424,"title":"[CS2] Compile all super calls to ES2015 super","user":{"login":"connec","id":160652,"avatar_url":"https://avatars.githubusercontent.com/u/160652?v=3","gravatar_id":"","url":"https://api.github.com/users/connec","html_url":"https://github.com/connec","followers_url":"https://api.github.com/users/connec/followers","following_url":"https://api.github.com/users/connec/following{/other_user}","gists_url":"https://api.github.com/users/connec/gists{/gist_id}","starred_url":"https://api.github.com/users/connec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connec/subscriptions","organizations_url":"https://api.github.com/users/connec/orgs","repos_url":"https://api.github.com/users/connec/repos","events_url":"https://api.github.com/users/connec/events{/privacy}","received_events_url":"https://api.github.com/users/connec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/jashkenas/coffeescript/milestones/10","html_url":"https://github.com/jashkenas/coffeescript/milestone/10","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/milestones/10/labels","id":2015479,"number":10,"title":"2.0.0","description":"A breaking-change release of CoffeeScript that outputs the latest implemented ECMAScript syntax whenever possible.","creator":{"login":"GeoffreyBooth","id":456802,"avatar_url":"https://avatars.githubusercontent.com/u/456802?v=3","gravatar_id":"","url":"https://api.github.com/users/GeoffreyBooth","html_url":"https://github.com/GeoffreyBooth","followers_url":"https://api.github.com/users/GeoffreyBooth/followers","following_url":"https://api.github.com/users/GeoffreyBooth/following{/other_user}","gists_url":"https://api.github.com/users/GeoffreyBooth/gists{/gist_id}","starred_url":"https://api.github.com/users/GeoffreyBooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeoffreyBooth/subscriptions","organizations_url":"https://api.github.com/users/GeoffreyBooth/orgs","repos_url":"https://api.github.com/users/GeoffreyBooth/repos","events_url":"https://api.github.com/users/GeoffreyBooth/events{/privacy}","received_events_url":"https://api.github.com/users/GeoffreyBooth/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":9,"state":"open","created_at":"2016-09-20T04:18:33Z","updated_at":"2017-01-26T06:54:23Z","due_on":null,"closed_at":null},"comments":26,"created_at":"2017-01-19T18:43:46Z","updated_at":"2017-01-26T16:07:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jashkenas/coffeescript/pulls/4424","html_url":"https://github.com/jashkenas/coffeescript/pull/4424","diff_url":"https://github.com/jashkenas/coffeescript/pull/4424.diff","patch_url":"https://github.com/jashkenas/coffeescript/pull/4424.patch"},"body":"Super quick first pass.  This breaks using `super` in non-methods, meaning several tests are failing. Self-compilation still works.\r\n\r\nAs I mentioned in https://github.com/coffeescript6/discuss/issues/22#issuecomment-273837748, the main decision to be made here is around support for `super` in non-class methods. Opinions from @jashkenas, @GeoffreyBooth, @lydell or anyone else very welcome!\r\n\r\nHere are a couple of the options:\r\n\r\n1. Go all in with ES2015, drop support for `super` outside of methods in class initializers. This would clean up some code in the compiler for tracking the classes of methods, special handling of prototype assignments in class bodies, etc.\r\n2. Why not both? If the super call is in a method in a class initializer, compile it to an ES2015 `super`, otherwise, compile it as we do now. This would just add a couple of special cases in the handling of `SuperCall` nodes.\r\n3. Try and devise some best of both worlds approach. Compile class method to ES2015. Since we can now use ES5+ method, we could drop `__super__`, method class recording, etc. and replace it all with `Object.getPrototypeOf(this.constructor)`. This could optionally turn `super` into a fully runtime feature that will compile anywhere, and would provide clean ES2015 output.\r\n\r\nPersonally, I'm leaning towards 1. for the significant impact I expect it will have on the compiler, and the fact that, realistically, the prototype-based approach is gonna be rare in an ES2015 world. If really, really needed, `super` in a dynamic method can still be specified explicitly (e.g. `BaseClass::method.apply(this, arguments)`).\r\n\r\nIf the compatibility break of such a move is too great, I'd be interested in exploring 3. I think that 2. would not be popular as it would force us to continue using class IIFEs to ensure correct parent class caching, etc. meaning 'ugly' JS output."},"comment":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/comments/275428976","html_url":"https://github.com/jashkenas/coffeescript/pull/4424#issuecomment-275428976","issue_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4424","id":275428976,"user":{"login":"jashkenas","id":4732,"avatar_url":"https://avatars.githubusercontent.com/u/4732?v=3","gravatar_id":"","url":"https://api.github.com/users/jashkenas","html_url":"https://github.com/jashkenas","followers_url":"https://api.github.com/users/jashkenas/followers","following_url":"https://api.github.com/users/jashkenas/following{/other_user}","gists_url":"https://api.github.com/users/jashkenas/gists{/gist_id}","starred_url":"https://api.github.com/users/jashkenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jashkenas/subscriptions","organizations_url":"https://api.github.com/users/jashkenas/orgs","repos_url":"https://api.github.com/users/jashkenas/repos","events_url":"https://api.github.com/users/jashkenas/events{/privacy}","received_events_url":"https://api.github.com/users/jashkenas/received_events","type":"User","site_admin":false},"created_at":"2017-01-26T16:07:34Z","updated_at":"2017-01-26T16:07:34Z","body":"> @GeoffreyBooth I think we need to have a discussion about static. CS already supports static with @name [:=] assignments, which is far more idiomatic within the language (no special syntax).\r\n\r\nI'd love to keep this sort of thing, and avoid the word `static` if possible. I think it's a terrible word for the feature, and is just legacy baggage from Java."}}
{"actor":{"display_login":"jashkenas"}}