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

Shadowed exported variables #91

Closed
Rich-Harris opened this issue Aug 21, 2015 · 0 comments · Fixed by #94
Closed

Shadowed exported variables #91

Rich-Harris opened this issue Aug 21, 2015 · 0 comments · Fixed by #94

Comments

@Rich-Harris
Copy link
Contributor

Given a situation like this...

var foo;

foo = (function () {
  return function foo () {
    return 42;
  };
})();

export { foo };

...we end up with this, which is a syntax error:

exports.foo = (function () {
  return function exports.foo () {
    return 42;
  };
})();

The offending line is here. I suspect the answer is to be smarter about creating new scopes, i.e. doing it at the BlockStatement level rather than the FunctionDeclaration/FunctionExpression level.

Rich-Harris added a commit that referenced this issue Aug 21, 2015
Rich-Harris added a commit that referenced this issue Aug 22, 2015
Victorystick added a commit that referenced this issue Aug 29, 2015
Prevent function expressions being incorrectly renamed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant