{"action":"created","issue":{"url":"https://api.github.com/repos/google/traceur-compiler/issues/2005","labels_url":"https://api.github.com/repos/google/traceur-compiler/issues/2005/labels{/name}","comments_url":"https://api.github.com/repos/google/traceur-compiler/issues/2005/comments","events_url":"https://api.github.com/repos/google/traceur-compiler/issues/2005/events","html_url":"https://github.com/google/traceur-compiler/issues/2005","id":116365714,"number":2005,"title":"InlineES6ModuleTransformer fails when two modules import to the same name.","user":{"login":"johnjbarton","id":205570,"avatar_url":"https://avatars.githubusercontent.com/u/205570?v=3","gravatar_id":"","url":"https://api.github.com/users/johnjbarton","html_url":"https://github.com/johnjbarton","followers_url":"https://api.github.com/users/johnjbarton/followers","following_url":"https://api.github.com/users/johnjbarton/following{/other_user}","gists_url":"https://api.github.com/users/johnjbarton/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjbarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjbarton/subscriptions","organizations_url":"https://api.github.com/users/johnjbarton/orgs","repos_url":"https://api.github.com/users/johnjbarton/repos","events_url":"https://api.github.com/users/johnjbarton/events{/privacy}","received_events_url":"https://api.github.com/users/johnjbarton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"johnjbarton","id":205570,"avatar_url":"https://avatars.githubusercontent.com/u/205570?v=3","gravatar_id":"","url":"https://api.github.com/users/johnjbarton","html_url":"https://github.com/johnjbarton","followers_url":"https://api.github.com/users/johnjbarton/followers","following_url":"https://api.github.com/users/johnjbarton/following{/other_user}","gists_url":"https://api.github.com/users/johnjbarton/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjbarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjbarton/subscriptions","organizations_url":"https://api.github.com/users/johnjbarton/orgs","repos_url":"https://api.github.com/users/johnjbarton/repos","events_url":"https://api.github.com/users/johnjbarton/events{/privacy}","received_events_url":"https://api.github.com/users/johnjbarton/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-11-11T16:06:34Z","updated_at":"2015-11-14T00:52:44Z","closed_at":null,"body":"Given two modules:\r\n```js\r\nimport {x} from './reexport-x.js';\r\nthis.result = x;  // To verify execution, test this global value.\r\n```\r\nand\r\n```js\r\n// Combine with import-x.js to test InlineES6ModuleTransformer\r\nimport {x} from './reexport-x.js';\r\nexport var y = x;\r\n```\r\nThe compilation with options `--modules=inline --outputLanguage=es6` will fail with\r\n```\r\nDuplicate declaration, x\r\n```\r\nThe generated code is \r\n```js\r\nconst $__test_47_unit_47_node_47_resources_47_x_46_js__ = (function() {\r\n  \"use strict\";\r\n  var x = 'x';\r\n  return {get x() {\r\n      return x;\r\n    }};\r\n})();\r\nconst $__test_47_unit_47_node_47_resources_47_reexport_45_x_46_js__ = (function() {\r\n  \"use strict\";\r\n  return {get x() {\r\n      return $__test_47_unit_47_node_47_resources_47_x_46_js__.x;\r\n    }};\r\n})();\r\n\"use strict\";\r\nconst {x} = $__test_47_unit_47_node_47_resources_47_reexport_45_x_46_js__;\r\nthis.result = x;\r\n\"use strict\";\r\nconst {x} = $__test_47_unit_47_node_47_resources_47_reexport_45_x_46_js__;\r\nexport var y = x;\r\n```\r\nThe problem is that the names in the ModuleSpecifierSet are not renamed:\r\nhttps://github.com/google/traceur-compiler/blob/master/src/codegeneration/InlineES6ModuleTransformer.js#L132"},"comment":{"url":"https://api.github.com/repos/google/traceur-compiler/issues/comments/156601130","html_url":"https://github.com/google/traceur-compiler/issues/2005#issuecomment-156601130","issue_url":"https://api.github.com/repos/google/traceur-compiler/issues/2005","id":156601130,"user":{"login":"arv","id":45845,"avatar_url":"https://avatars.githubusercontent.com/u/45845?v=3","gravatar_id":"","url":"https://api.github.com/users/arv","html_url":"https://github.com/arv","followers_url":"https://api.github.com/users/arv/followers","following_url":"https://api.github.com/users/arv/following{/other_user}","gists_url":"https://api.github.com/users/arv/gists{/gist_id}","starred_url":"https://api.github.com/users/arv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arv/subscriptions","organizations_url":"https://api.github.com/users/arv/orgs","repos_url":"https://api.github.com/users/arv/repos","events_url":"https://api.github.com/users/arv/events{/privacy}","received_events_url":"https://api.github.com/users/arv/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T00:52:44Z","updated_at":"2015-11-14T00:52:44Z","body":"This works:\r\n\r\n```\r\nnode src/node/command.js --out out.js --modules=inline --outputLanguage=es6 -- test/unit/node/resources/import-x.js\r\n```\r\n\r\nWhat I'm saying is that we should not allow more than one input file here. That way there cannot be any naming conflicts.\r\n\r\nHowever, I do see a use case to do what rollupjs is doing and put all the imported modules into the same scope so that imported bindings are truly the same binding as the exported one."}}