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

Duplicate switch case #257

Merged
merged 1 commit into from Apr 19, 2019

Conversation

Projects
None yet
2 participants
@MatheusRV
Copy link
Contributor

commented Apr 18, 2019

If two cases in a switch statement have the same label, the second case will never be executed.

In JavaScript, cases in a switch statement can have arbitrary expressions as their labels. The interpreter does not check that these expressions are all different. At runtime, if two cases in a switch statement have the same label, the second case will never be executed. This most likely indicates a copy-paste error where the first case was copied and then not properly adjusted.

Duplicate switch case
If two cases in a switch statement have the same label, the second case will never be executed.
@stasm

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

Thanks for the PR! This must have been a copy&paste error. Well spotted!

@stasm stasm merged commit 2bc4b44 into projectfluent:master Apr 19, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.