Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle compact inside arrow functions #339

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

Merged
sirbrillig merged 6 commits into 2.x from handle-compact-in-fat-arrow
Dec 1, 2024
Merged

Conversation

@sirbrillig
Copy link
Owner

@sirbrillig sirbrillig commented Dec 1, 2024
edited
Loading

The code to detect and process variables inside calls to compact() (please, stop using that function 😩) was finding and processing those variables all at once, using the scope of the compact token itself as if it were a variable. However, this does not work for compact used inside arrow functions because there are multiple possible scopes for each variable.

In this PR, we refactor the code to process each variable inside compact() separately, allowing us to determine each one's scope before determining if it is defined.

Fixes #330

@sirbrillig sirbrillig merged commit c3780f2 into 2.x Dec 1, 2024
62 checks passed
@sirbrillig sirbrillig deleted the handle-compact-in-fat-arrow branch December 1, 2024 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Arrow Functions and compact method cause false positive for UndefinedVariable bug

2 participants

AltStyle によって変換されたページ (->オリジナル) /