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

Code Path Analysis cannot handle LabeledStatement with other than switches or loops. #5171

Closed
mysticatea opened this issue Feb 6, 2016 · 1 comment
Assignees
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 bug ESLint is working incorrectly core Relates to ESLint's core APIs and features

Comments

@mysticatea
Copy link
Member

I had not known it at that time.
This causes some false positive of rules which are using code path (e.g. no-unreachable).

A: {
    break A;
}

foo(); // Unreachable code. (no-unreachable) <<< false positive

I will fix this.

@mysticatea mysticatea added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion labels Feb 6, 2016
@mysticatea mysticatea self-assigned this Feb 6, 2016
@mysticatea
Copy link
Member Author

This foolproof code has prevented crash :D

mysticatea added a commit to mysticatea/eslint that referenced this issue Feb 6, 2016
Code Path Analysis comes to handle labels with other than loops and
switches correctly.

Before, it has been handling `break` statements on loop contexts and
switch contexts. But now, it's handling `break` statements on
independent `break` contexts.
nzakas added a commit that referenced this issue Feb 7, 2016
Fix: code path analysis and labels (fixes #5171)
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
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 bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

No branches or pull requests

1 participant