Skip to content

Shadowed exported variables #91

Description

@Rich-Harris

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions