angular/angular.js — pull request #9363 by lucasconstantino (2014-10-01 08:04:16+00:00)
Title: feat(controller): allow named function syntax when registering controllers

This pull-request means to introduce two new syntax for registering controllers:

```js
$controllerProvider.register(function FooCtrl($scope) {
// ...
});

$controllerProvider.register(['$sope', function FooCtrl($scope) {
// ...
}]);
```

As it is shown above, using a named function we can remove the need for the first argument on the controller declaration, which was the controller's name.

This feature relies first on [Function.name](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name), which is currently implemented in most major browsers, with the exception of Internet Explorer. Because of that, I have also added a fallback method to get a function's name, which was mostly based on @dfkaye's [Gist](https://gist.github.com/dfkaye/6384439), although I've pretty much skiped the validation part which I think is unecessary for this case.

*P.s.: I've made tests for both use-cases and all test (including e2e) seem to be working just fine.*