Skip to content

Conversation

@matbrgz
Copy link
Contributor

@matbrgz matbrgz 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.

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

stasm 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants