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

re-exporting and renaming when scopehoisting #2491

Merged
merged 1 commit into from Jan 12, 2019

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Jan 1, 2019

↪️ Pull Request

Renaming an identifier incorrectly renaming the local identifier of re-export+rename statements as well. (i.e. a function named x and export {x as func) from "...";)

This is fixing babel/babel#9266 manually, because parcel doesn't use babel's scope.rename. Maybe we should wait for the babel team to respond there
Closes #2284

💻 Examples

Described in babel/babel#9266

✔️ PR Todo

  • Added/updated unit tests for this change
  • Included links to related issues/PRs

@garthenweb
Copy link
Contributor

I have the same issue when importing memoize-one and can prove that this PR is fixing it in my project 👍

@devongovett
Copy link
Member

Seems like the real issue is that x is in the referencePaths at all. x in the export specifier does not actually reference the local variable x. Seems like an ok workaround though.

@devongovett devongovett merged commit 58a0348 into master Jan 12, 2019
@devongovett devongovett deleted the scope-hoist-reexport-rename branch January 12, 2019 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scope Hoisting bug with libphonenumber-js
3 participants