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
Fixed issue with programPath.scope.references not being registered back correctly after scope re-crawling #11323
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Andarist Would it be possible to also add a test using generateUid
, which is how you found ths bug?
path.scope.crawl(); | ||
path.scope.crawl(); | ||
|
||
expect(path.scope.references.jsx).toBeTruthy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I have no idea of what references
on the scope
means since it's clearly not related to binding.referencePaths
. However, this PR aligns the post-crawl state to the pre-crawl one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is the full story but those references seem to be a simple Record<name, true>
of everything that could clash with generated identifiers (or other nodes), since it's not possible to just check some single scope to be sure if some name can be considered "sage", but it rather requires full knowledge about the module/script
Sure, should I add it to the same file? Or is there a better place for a test like this? |
It's ok in this file. |
…ck correctly after scope re-crawling
6c5b35d
to
3ccb3ba
Compare
References were not correctly registered back on subsequent crawls for cases when bindings were already registered on some inner scopes.