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 typo on no-label-var
#1029
Fix typo on no-label-var
#1029
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that is meant to be a label, so it is the proper syntax.
It could possibly be better to have something else as the statement to be less confusing. Maybe something like:
var score = 100
function game () {
score: while (gems > 0) {
score += 10
if (score < 100) continue score
break
}
}
Good point, and it actually illustrates the label use. What do you think about simplifying the example even more? score: while (true) {
score -= 10
if (score > 0) continue score
break
} or var score = 100
function game () {
score: while (true) {
score -= 10
if (score > 0) continue score
break
}
} |
Sounds very good 👍 |
Looks like git doesn't like ticks in commit messages... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat 👍
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Credit to @lacymorrow for this commit Fixes: #1029
@lacymorrow Hey! Apologies that this never got merged. It looks like there are merge conflicts now, and rather than ask you to fix them up I tried to do so. However, I ran into issues and decided to just copy your changes into a new PR. I hope this is okay. Thanks for the great work. Cheers! |
Credit to @lacymorrow for this commit Fixes: #1029
Credit to @lacymorrow for this commit Fixes: standard/standard#1029
I'm pretty sure that the author meant to use an equal operator...