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

[BUGFIX] if our ancestor import declaration is removed short-circuit … #79

Merged
merged 1 commit into from
Jun 20, 2019

Conversation

stefanpenner
Copy link
Contributor

…gracefully

@@ -58,8 +58,13 @@ module.exports = class Macros {
if (!this.debugHelpers.module) {
if (this.localDebugBindings.length > 0) {
let importPath = this.localDebugBindings[0].findParent(p => p.isImportDeclaration());
if (importPath === null) {
// import declaration in question seems to have already been removed
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this in the wild, my guess is two babel plugins are both mutating the graph. Resulting in this outcome...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, those two babel plugins both operate on separate import paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a test?

@stefanpenner
Copy link
Contributor Author

@rwjblue ya, trying to come up with one that is representative. Although I'm not 100% sure my above idea is the root cause.

@rwjblue rwjblue added the bug label Jun 20, 2019
@rwjblue rwjblue merged commit 887bdbc into master Jun 20, 2019
@rwjblue rwjblue deleted the short-circuit branch June 20, 2019 15:50
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.

2 participants