{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3503","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3503/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3503/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3503/events","html_url":"https://github.com/ember-cli/ember-cli/issues/3503","id":60661060,"number":3503,"title":"Anonymous functions being transpiled to named functions in 0.2.0","user":{"login":"pmdarrow","id":586800,"avatar_url":"https://avatars.githubusercontent.com/u/586800?v=3","gravatar_id":"","url":"https://api.github.com/users/pmdarrow","html_url":"https://github.com/pmdarrow","followers_url":"https://api.github.com/users/pmdarrow/followers","following_url":"https://api.github.com/users/pmdarrow/following{/other_user}","gists_url":"https://api.github.com/users/pmdarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/pmdarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmdarrow/subscriptions","organizations_url":"https://api.github.com/users/pmdarrow/orgs","repos_url":"https://api.github.com/users/pmdarrow/repos","events_url":"https://api.github.com/users/pmdarrow/events{/privacy}","received_events_url":"https://api.github.com/users/pmdarrow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-11T13:51:49Z","updated_at":"2015-03-11T16:16:52Z","closed_at":"2015-03-11T16:12:51Z","body":"Something in the build pipeline (babel?) is rewriting anonymous functions as named functions in Ember-CLI 0.2.0 and giving me an error in one of my tests. Example:\r\n\r\n```js\r\nimport myFunc from './my-func';\r\n\r\nfunction test() {\r\n  var myObj = {\r\n    myFunc: function() {return true;} // anonymous function\r\n  };\r\n  myFunc();\r\n}\r\n```\r\nis transpiled to:\r\n```js\r\n...\r\n\r\nfunction test() {\r\n  var myObj = {\r\n    myFunc: function myFunc() {return true;} // named function\r\n  };\r\n  myFunc(); // \"myFunc is not defined\"\r\n}\r\n```\r\n\r\nI fixed the issue by using an arrow function for the anonymous function, but I wanted to know if this is expected behaviour and why my anonymous function is being transpiled to a named one?"},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/78296836","html_url":"https://github.com/ember-cli/ember-cli/issues/3503#issuecomment-78296836","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3503","id":78296836,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T16:16:52Z","updated_at":"2015-03-11T16:16:52Z","body":"```\r\n± % npm ls | grep babel-core                                                                                                                                                                                                                                                                                                                                                                                                       !3517\r\n│ │ ├─┬ babel-core@4.7.4\r\n```"}}