{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/3816","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/3816/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/3816/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/3816/events","html_url":"https://github.com/jashkenas/coffeescript/issues/3816","id":55949613,"number":3816,"title":"In 1.9.0, Coffeescript breaks Angular dependency injection","user":{"login":"bcherny","id":1761758,"avatar_url":"https://avatars.githubusercontent.com/u/1761758?v=3","gravatar_id":"","url":"https://api.github.com/users/bcherny","html_url":"https://github.com/bcherny","followers_url":"https://api.github.com/users/bcherny/followers","following_url":"https://api.github.com/users/bcherny/following{/other_user}","gists_url":"https://api.github.com/users/bcherny/gists{/gist_id}","starred_url":"https://api.github.com/users/bcherny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcherny/subscriptions","organizations_url":"https://api.github.com/users/bcherny/orgs","repos_url":"https://api.github.com/users/bcherny/repos","events_url":"https://api.github.com/users/bcherny/events{/privacy}","received_events_url":"https://api.github.com/users/bcherny/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jashkenas/coffeescript/labels/change","name":"change","color":"178c3c"},{"url":"https://api.github.com/repos/jashkenas/coffeescript/labels/fixed","name":"fixed","color":"000000"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-01-29T20:07:29Z","updated_at":"2015-02-02T20:38:38Z","closed_at":"2015-01-29T21:24:34Z","body":"If I had the following code:\r\n\r\n```coffee\r\nbeforeEach ->\r\n  module 'foo'\r\n  inject (@$httpBackend, @$templateCache, @foo) =>\r\n```\r\n\r\n**1.8.0** compiles it to:\r\n\r\n```js\r\nbeforeEach(function() {\r\n  module('foo');\r\n  return inject((function(_this) {\r\n    return function($httpBackend, $templateCache, foo) {\r\n      _this.$httpBackend = $httpBackend;\r\n      _this.$templateCache = $templateCache;\r\n      _this.foo = foo;\r\n    };\r\n  })(this));\r\n});\r\n```\r\n\r\nWhile **1.9.0** produces:\r\n\r\n```js\r\nbeforeEach(function() {\r\n  module('foo');\r\n  return inject((function(_this) {\r\n    return function(_at_$httpBackend, _at_$templateCache, _at_foo) {\r\n      _this.$httpBackend = _at_$httpBackend;\r\n      _this.$templateCache = _at_$templateCache;\r\n      _this.foo = _at_foo;\r\n    };\r\n  })(this));\r\n});\r\n```\r\n\r\nThe issue is that Angular parses the function parameters to figure out which dependencies to inject into the test. `$httpBackend` is a valid dependency, but `_at_$httpBackend` is not, breaking the test."},"comment":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/comments/72532964","html_url":"https://github.com/jashkenas/coffeescript/issues/3816#issuecomment-72532964","issue_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/3816","id":72532964,"user":{"login":"DavidSouther","id":498712,"avatar_url":"https://avatars.githubusercontent.com/u/498712?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidSouther","html_url":"https://github.com/DavidSouther","followers_url":"https://api.github.com/users/DavidSouther/followers","following_url":"https://api.github.com/users/DavidSouther/following{/other_user}","gists_url":"https://api.github.com/users/DavidSouther/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidSouther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidSouther/subscriptions","organizations_url":"https://api.github.com/users/DavidSouther/orgs","repos_url":"https://api.github.com/users/DavidSouther/repos","events_url":"https://api.github.com/users/DavidSouther/events{/privacy}","received_events_url":"https://api.github.com/users/DavidSouther/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T20:38:38Z","updated_at":"2015-02-02T20:38:38Z","body":"As closed in the referenced 3817, as well as numerous threads on Coffee Script Redux, this is expected and dependent behavior that WILL cause issues with installed codebases and WILL break existing deployments."}}