{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/319","labels_url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/319/comments","events_url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/319/events","html_url":"https://github.com/dart-lang/dev_compiler/pull/319","id":106330527,"number":319,"title":"Qualified exports and inheritance for Closure","user":{"login":"ochafik","id":273860,"avatar_url":"https://avatars.githubusercontent.com/u/273860?v=3","gravatar_id":"","url":"https://api.github.com/users/ochafik","html_url":"https://github.com/ochafik","followers_url":"https://api.github.com/users/ochafik/followers","following_url":"https://api.github.com/users/ochafik/following{/other_user}","gists_url":"https://api.github.com/users/ochafik/gists{/gist_id}","starred_url":"https://api.github.com/users/ochafik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ochafik/subscriptions","organizations_url":"https://api.github.com/users/ochafik/orgs","repos_url":"https://api.github.com/users/ochafik/repos","events_url":"https://api.github.com/users/ochafik/events{/privacy}","received_events_url":"https://api.github.com/users/ochafik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-14T12:30:37Z","updated_at":"2015-09-15T00:01:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dart-lang/dev_compiler/pulls/319","html_url":"https://github.com/dart-lang/dev_compiler/pull/319","diff_url":"https://github.com/dart-lang/dev_compiler/pull/319.diff","patch_url":"https://github.com/dart-lang/dev_compiler/pull/319.patch"},"body":"Hey guys, I know this is a big chunk of changes, sorry about that! (introducing properly qualified exports without doing some refactoring otherwise ended up in very unmaintainable code :-S).\r\n\r\nThis fixes two blockers for issue #312 (redefining `Object` class and other similar collisions with JS classes, and extending a non-qualifier class expression such as `dart.mixin(...)`).\r\n\r\nBiggest changes in js_codegen.dart:\r\n- Qualify exports when `--closure`: declarations are now emitted by method `_emitDecl`, which knows when to export things, and `exports` is renamed to the lib's temp name (e.g. `mylib.Foo = class Foo {}` instead of `class Foo {}; exports.Foo = Foo`).\r\n- Simplified class building with `_ClassBuilder` helper (accumulates body, statements & preludes, then gets composed to top-level statements / lazy wrappers in one go). This makes it easier to switch to fully-qualified names in all the statements that go with a class definition. Updated the lazy class logic accordingly.\r\n- Refactored `visitClassDeclaration` to make it (hopefully) easier to read with the new builder mechanism\r\n\r\nThis gives minor changes in generated code: shuffled symbols & JS iterator method moved to the end of classes (+ some exports.References are now local (fixed))."},"comment":{"url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/comments/140236453","html_url":"https://github.com/dart-lang/dev_compiler/pull/319#issuecomment-140236453","issue_url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/319","id":140236453,"user":{"login":"jmesserly","id":1081711,"avatar_url":"https://avatars.githubusercontent.com/u/1081711?v=3","gravatar_id":"","url":"https://api.github.com/users/jmesserly","html_url":"https://github.com/jmesserly","followers_url":"https://api.github.com/users/jmesserly/followers","following_url":"https://api.github.com/users/jmesserly/following{/other_user}","gists_url":"https://api.github.com/users/jmesserly/gists{/gist_id}","starred_url":"https://api.github.com/users/jmesserly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmesserly/subscriptions","organizations_url":"https://api.github.com/users/jmesserly/orgs","repos_url":"https://api.github.com/users/jmesserly/repos","events_url":"https://api.github.com/users/jmesserly/events{/privacy}","received_events_url":"https://api.github.com/users/jmesserly/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T00:01:22Z","updated_at":"2015-09-15T00:01:22Z","body":"Aside: it might be worth refactoring out a high level class node. Like ClassInfo/Builder. So we can represent concepts of a generic class and method signatures, without containing the policy of exactly how those get emitted. Ideally that could be in its own CL, so we can review the refactoring without any changes in output or new features.\r\n"}}