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 typo on no-label-var #1029

Closed
wants to merge 5 commits into from
Closed

Fix typo on no-label-var #1029

wants to merge 5 commits into from

Conversation

lacymorrow
Copy link

I'm pretty sure that the author meant to use an equal operator...

Copy link
Member

@LinusU LinusU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore

Copy link
Member

@LinusU LinusU left a 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
  }
}

@lacymorrow
Copy link
Author

lacymorrow commented Dec 18, 2017

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
  }
}

@LinusU
Copy link
Member

LinusU commented Dec 18, 2017

Sounds very good 👍

@lacymorrow
Copy link
Author

Looks like git doesn't like ticks in commit messages...
Updated, take a look and let me know what you think 👍

Copy link
Member

@LinusU LinusU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat 👍

@stale
Copy link

stale bot commented May 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 10, 2018
feross added a commit that referenced this pull request May 11, 2018
Credit to @lacymorrow for this commit

Fixes: #1029
@feross
Copy link
Member

feross commented May 11, 2018

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

#1129

I hope this is okay. Thanks for the great work. Cheers!

@stale stale bot removed the stale label May 11, 2018
feross added a commit that referenced this pull request May 11, 2018
Credit to @lacymorrow for this commit

Fixes: #1029
@feross feross closed this in #1129 May 11, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 2018
suchitg8 pushed a commit to suchitg8/standard that referenced this pull request Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants