-
Notifications
You must be signed in to change notification settings - Fork 7
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
displayName is added to regular JS objects #19
Comments
Thanks for the report! This is indeed a bug, I am able to reproduce it with the following code:
|
I'd be happy to assist however I can, it seems that the walking logic and |
I think you're right thatsomething with handling of ancestors will definitely need to change since that's where it's finding 'JSXExample' in the example code above. I took a look, and the logic that's checking the ancestors is used to detect references like this If you comment out the
to this when it's minified:
So I think what we need is a way to preserve that behavior without having false positive matches like the one you reported. If you're willing to assist, I'll definitely review and merge the PR. Thanks again for reporting! |
Hi @iMoses-Apiiro I will start work on a fix here soon but if you're planning on opening a PR just let me know and I'll hold off. |
I have a large map in my code that looks something like this:
which I elsewhere use to fetch the relevant functions per
actionType
so I'm expecting the values to all be objects,and now all of a sudden I'm getting:
After a short debugging this seems to be the problem:
the assumption here about arrow functions is a little too generic :)
Expected
if
nameFunc
returns JSX thenMANAGE_ACTIONS.actionType.nameFunc.displayName === 'nameFunc'
Actual
MANAGE_ACTIONS.displayName === 'MANAGE_ACTIONS'
The text was updated successfully, but these errors were encountered: