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

Update: support logical assignments in code path analysis (refs #13569) #13612

Merged
merged 2 commits into from Aug 31, 2020

Conversation

mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Aug 24, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[X] Add something to the core

refs #13569

Adds support for logical assignments in code path analysis.

What changes did you make? (Give an overview)

Updated code path analysis to account for short-circuiting semantics of logical assignments.

Is there anything you'd like reviewers to focus on?

(a &&= b) ?? c works in line with how (a && b) ?? c already works, but I think (a && b) ?? c isn't entirely correct (#13614).

@mdjermanovic mdjermanovic added core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion do not merge This pull request should not be merged yet new syntax This issue is related to new syntax that has reached stage 4 labels Aug 24, 2020
@mdjermanovic mdjermanovic force-pushed the logicalassignment-codepathanalysis branch from 6bc7657 to faa0094 Compare August 24, 2020 19:01
@mdjermanovic mdjermanovic mentioned this pull request Aug 24, 2020
12 tasks
@mdjermanovic mdjermanovic removed the do not merge This pull request should not be merged yet label Aug 24, 2020
@mdjermanovic mdjermanovic changed the title Update: support logical assignment in code path analysis (refs #13569) Update: support logical assignments in code path analysis (refs #13569) Aug 25, 2020
Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

Looks good as far as I can tell based on the dot graphs, though as with most things code path-related, I'd feel better if @mysticatea had a chance to take a look.

Good catch on the (a && b) ?? c issue. Since that's a pre-existing bug, I agree with leaving it alone in this PR 👍

Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

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

LGTM.

I'm sorry that I have not tackled this, and thank you very much!
These code changes are completely same as my local's (including spaces, but except comments and tests).

@kaicataldo kaicataldo merged commit 58abd93 into master Aug 31, 2020
@kaicataldo kaicataldo deleted the logicalassignment-codepathanalysis branch August 31, 2020 21:30
@kaicataldo
Copy link
Member

Thanks for working on this!

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 18, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features new syntax This issue is related to new syntax that has reached stage 4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants