{"action":"closed","issue":{"url":"https://api.github.com/repos/babel/babel/issues/2178","labels_url":"https://api.github.com/repos/babel/babel/issues/2178/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/2178/comments","events_url":"https://api.github.com/repos/babel/babel/issues/2178/events","html_url":"https://github.com/babel/babel/issues/2178","id":99569419,"number":2178,"title":"Babel transforms polyfill in wrong place while using Generator.","user":{"login":"Foolyou","id":6925615,"avatar_url":"https://avatars.githubusercontent.com/u/6925615?v=3","gravatar_id":"","url":"https://api.github.com/users/Foolyou","html_url":"https://github.com/Foolyou","followers_url":"https://api.github.com/users/Foolyou/followers","following_url":"https://api.github.com/users/Foolyou/following{/other_user}","gists_url":"https://api.github.com/users/Foolyou/gists{/gist_id}","starred_url":"https://api.github.com/users/Foolyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Foolyou/subscriptions","organizations_url":"https://api.github.com/users/Foolyou/orgs","repos_url":"https://api.github.com/users/Foolyou/repos","events_url":"https://api.github.com/users/Foolyou/events{/privacy}","received_events_url":"https://api.github.com/users/Foolyou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-07T03:18:34Z","updated_at":"2015-08-07T10:31:31Z","closed_at":"2015-08-07T10:31:31Z","body":"With this code:\r\n```\r\nrequire('babel/polyfill');\r\n\r\nfunction* g() {\r\n\tyield 1;\r\n}\r\n```\r\n\r\nBabel gives:\r\n```\r\n'use strict';\r\n\r\nvar marked0$0 = [g].map(regeneratorRuntime.mark);\r\nrequire('babel/polyfill');\r\n\r\nfunction g() {\r\n\treturn regeneratorRuntime.wrap(function g$(context$1$0) {\r\n\t\twhile (1) switch (context$1$0.prev = context$1$0.next) {\r\n\t\t\tcase 0:\r\n\t\t\t\tcontext$1$0.next = 2;\r\n\t\t\t\treturn 1;\r\n\r\n\t\t\tcase 2:\r\n\t\t\tcase 'end':\r\n\t\t\t\treturn context$1$0.stop();\r\n\t\t}\r\n\t}, marked0$0[0], this);\r\n}\r\n```\r\nwhere <code>var marked0$0 = [g].map(regeneratorRuntime.mark);</code> appears before <code>require('babel/polyfill');</code>. That makes an error: <code>regeneratorRuntime undefined</code>."}}