Detection of chained call fails if one of the chained calls does not need to be annotated
Closed this issue · 4 comments
thesamet commented
If I have:
angular.module('myMod')
.config(['dep1', function(dep1) {}])
.run(function(dep2) {});
Then the run() call will not get annotated. This happens because astral-angular-annotate requires the argument of config() to be a function (and not an ArrayExpression) in signatures/simple.js
Here is a failing unit test to demonstrate this:
it('should annotate multiple chained declarations', function() {
var annotated = annotate(function () {
angular.module('myMod')
.config(['dep1', function(dep1) {}])
.run(function(dep2) {});
});
annotated.should.equal(stringifyFunctionBody(function () {
angular.module('myMod')
.config(['dep1', function(dep1) {}])
.run(['dep2', function(dep2) {}]);
}));
});
BinaryMuse commented
Is this the same as #50?
btford commented
thesamet commented
Oops! I did - and missed it somehow, sorry.