Skip to content

False matches on .decorator methods #82

@schmod

Description

@schmod

Currently, ng-annotate is aggressively annotating functions with .decorator() methods.

Specifically, ui-router's $stateProvider.decorator() method does not use DI injections, and breaks if ngAnnotate processes a file that calls it:

Original:

$stateProvider.decorator('parent', function (state, parentFn) {
  doStuff();
});

After ng-annotate:

$stateProvider.decorator('parent', ["state", "parentFn", function (state, parentFn) {
  doStuff();
}]);

Given that ui-router does not expect an array to be passed into this function, any code that calls $stateProvider.decorator() will break if it's processed by ngAnnotate.

Given that decorator is potentially a rather generic name, ng-annotate needs to be a lot less aggressive when matching some of these methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions