Skip to content

Add missing scopes when adding reference to scope tracker - #860

Closed
devongovett wants to merge 1 commit into
babel:masterfrom
devongovett:patch-1
Closed

devongovett wants to merge 1 commit into
babel:masterfrom
devongovett:patch-1

Conversation

@devongovett

Copy link
Copy Markdown

Fixes "Cannot read property 'add' of undefined" error. #792 #556

Fixes "Cannot read property 'add' of undefined" error. babel#792 babel#556

@boopathi boopathi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure about this fix. I think it can regress in other ways which may be harder to debug. Now the references which we detected in one scope are added to a completely different scope which was not in our initial scope tree. The parent scope should have been there in the scope tracker. For some reason, it's not added during the collection phase. Let's find out why that happens or drill down more.

@devongovett

Copy link
Copy Markdown
Author

Ok I found the problem in my code. Needed to cloneDeep a node before inserting it multiple times.

@devongovett
devongovett deleted the patch-1 branch May 20, 2018 23:44
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

Successfully merging this pull request may close these issues.

2 participants