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

Fix: fix wrong code-path about try-for-in (fixes #8848) #9348

Merged
merged 1 commit into from Sep 27, 2017

Conversation

mysticatea
Copy link
Member

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

[X] Bug fix (template)

Fixes #8848.

What changes did you make? (Give an overview)

This PR fixes code path analysis to generate correct code paths.

Before, it was wrong if ForInStatement#right is the first throwable location (e.g. a variable reference, a call expression, ...) in the outer try block. (It makes 2 paths from try block to catch block at the first throwable location and the end of try block. The former seemed to conflict with the looping path of for-in.)

In the following code:

try {
    for (let x of xs) {
    }
} catch (err) {
}
Before: broken code path.

Before: broken code path

After: correct code path.

after


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

Nothing in particular.

@eslintbot
Copy link

LGTM

@mention-bot
Copy link

@mysticatea, thanks for your PR! By analyzing the history of the files in this pull request, we identified @gyandeeps, @not-an-aardvark and @kaicataldo to be potential reviewers.

@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules labels Sep 25, 2017
@ilyavolodin ilyavolodin merged commit 38d0cb2 into master Sep 27, 2017
@ilyavolodin ilyavolodin deleted the issue8848 branch September 27, 2017 02:04
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 27, 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 Mar 27, 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 rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read property 'superCalled' of undefined
7 participants