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

[eslint-plugin-react-hooks] Fixed crash when referencing arguments in arrow functions. #16356

Merged

Conversation

hristo-kanchev
Copy link
Contributor

Description:
Referencing arguments from inside an arrow function caused a crash.

Fixes issue: #16003

@sizebot
Copy link

sizebot commented Aug 11, 2019

Warnings
⚠️

Base commit is broken: 7a7e792

Generated by 🚫 dangerJS

const def = reference.resolved.defs[0];

// Ignore if def is undefined - e.g. `arguments` binding.
if (def === undefined) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's make this sloppy == null and then remove != null from next comparison.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good shout! I've updated the PR.

@gaearon gaearon merged commit 9e64bf1 into facebook:master Aug 14, 2019
@gaearon
Copy link
Collaborator

gaearon commented Aug 14, 2019

Thanks

@hristo-kanchev hristo-kanchev deleted the bugfix/exhaustive-deps-def-crash branch August 14, 2019 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants