{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1622","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1622/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1622/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1622/events","html_url":"https://github.com/Microsoft/TypeScript/issues/1622","id":53821076,"number":1622,"title":"Change the emit for `__extends` to support easy global override","user":{"login":"basarat","id":874898,"avatar_url":"https://avatars.githubusercontent.com/u/874898?v=3","gravatar_id":"","url":"https://api.github.com/users/basarat","html_url":"https://github.com/basarat","followers_url":"https://api.github.com/users/basarat/followers","following_url":"https://api.github.com/users/basarat/following{/other_user}","gists_url":"https://api.github.com/users/basarat/gists{/gist_id}","starred_url":"https://api.github.com/users/basarat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basarat/subscriptions","organizations_url":"https://api.github.com/users/basarat/orgs","repos_url":"https://api.github.com/users/basarat/repos","events_url":"https://api.github.com/users/basarat/events{/privacy}","received_events_url":"https://api.github.com/users/basarat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-09T00:48:14Z","updated_at":"2015-01-23T21:45:58Z","closed_at":null,"body":"Change the emit for `__extends` to be : \r\n\r\n```js\r\nvar __root = typeof global !== \"undefined\" && global || typeof window !== \"undefined\" && window || this;\r\nvar __extends = __root.__extends = __root.__extends || function (d, b) {\r\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n    function __() { this.constructor = d; }\r\n    __.prototype = b.prototype;\r\n    d.prototype = new __();\r\n}\r\n```\r\n# Reason:\r\nIt will allow you to override `__extends` globally with a single `require` call to a file that contains the following: \r\n```js\r\nvar __root = typeof global !== \"undefined\" && global || typeof window !== \"undefined\" && window || this;\r\n__root.__extends = function(d,b){/*custom __extends implementation*/}\r\n```\r\nNote: all AMD / CommonJS / internal modules will work\r\n\r\nMore : https://github.com/Microsoft/TypeScript/issues/1601#issuecomment-69235352"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/71271591","html_url":"https://github.com/Microsoft/TypeScript/issues/1622#issuecomment-71271591","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1622","id":71271591,"user":{"login":"pspeter3","id":607701,"avatar_url":"https://avatars.githubusercontent.com/u/607701?v=3","gravatar_id":"","url":"https://api.github.com/users/pspeter3","html_url":"https://github.com/pspeter3","followers_url":"https://api.github.com/users/pspeter3/followers","following_url":"https://api.github.com/users/pspeter3/following{/other_user}","gists_url":"https://api.github.com/users/pspeter3/gists{/gist_id}","starred_url":"https://api.github.com/users/pspeter3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pspeter3/subscriptions","organizations_url":"https://api.github.com/users/pspeter3/orgs","repos_url":"https://api.github.com/users/pspeter3/repos","events_url":"https://api.github.com/users/pspeter3/events{/privacy}","received_events_url":"https://api.github.com/users/pspeter3/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T21:45:58Z","updated_at":"2015-01-23T21:45:58Z","body":"Another option seems to be generating an extends module and having it be imported by all modules that use extends"}}