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

Chasing method names in assignment should take operator into account #210

Open
mozfreddyb opened this issue Oct 31, 2022 · 1 comment
Open

Comments

@mozfreddyb
Copy link
Collaborator

This is a follow-up from #207 and #206.
The patch fixed working with function calls in code like (a = b)(foo), but did not take the assignment operator into account.

A simple equal sign will ensure that only b will ever be called, as it is assigned into a.
However, operators like ||= will not.

@mozfreddyb
Copy link
Collaborator Author

Turns out this will require a bit of a refactor.
Currently, this comes up in normalizeMethodName() which is supposed to return one method name as the normalized name. However, in case of a call like a ||= b)(foo) the function that's called is either a or b, so we need to check both..

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

No branches or pull requests

1 participant