Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to catch babel-renamed function arguments? #40

Open
dlinnemeyer opened this issue Jan 24, 2018 · 3 comments
Open

Any way to catch babel-renamed function arguments? #40

dlinnemeyer opened this issue Jan 24, 2018 · 3 comments

Comments

@dlinnemeyer
Copy link

I ran into a problem related to babel renaming function arguments when they collide with babel adding names to anonymous functions (stack overflow discussion on it here: https://stackoverflow.com/q/38383512). We have a DI argument named foo, which gets renamed to _foo by babel , which breaks angular annotations.

We start with something like this:

function(foo) {
  var bar = {
    foo: function() {}
  };
}

And get:

['_foo', function(_foo) {
  var bar = {
    foo: function foo() {}
  };
}]

I'm guessing this isn't a bug in angularjs-annotate, but I'm wondering if there's any way to run annotations prior to babel renaming arguments? Or is that impossible the way babel plugins are structured?

@schmod
Copy link
Owner

schmod commented Jan 24, 2018

We should know when babel renames function arguments. We've had issues in the past where Babel wasn't properly communicating to us that it was renaming things, and it looks like that's what's happening here again... :-(

@dlinnemeyer
Copy link
Author

Oh, interesting, thanks for the info. So what would be the next step? Not sure I understand the problem with the internals well enough to report a bug for babel itself.

@Cererec
Copy link

Cererec commented Apr 18, 2019

Hi I am experiencing this kind of problem, any fixes on this?

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants