btford/ngmin — pull request #33 by BinaryMuse (2013-05-09 05:30:49+00:00)
Title: Annotate provider's `this.$get` function

Hi, Brian,

This pull request annotates `this.$get = function(dep)` in providers (#31). From the test, it transforms:

```javascript
angular.module('myMod', []).
provider('myService', function (dep) {
this.$get = function(otherDep) {};
});
```

into this:

```javascript
angular.module('myMod', []).provider('myService', [
'dep',
function (dep) {
this.$get = ['otherDep', function(otherDep) {}];
}
]);
```

It's based of the DDO annotation code in `lib/annotate-ast.js`. I've also included some refactoring in that file that extracts repeated code from inside the final `deepApply`s into a function `annotateInjectables` (I'll let you decide on a decent name :) that takes the argument usually named `originalFn` and returns the `ArrayExpression` it should be replaced with (or else returns `originalFn` if nothing is to be annotated).