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

do-expressions and nested breaks #11608

Closed
bakkot opened this issue May 25, 2020 · 5 comments · Fixed by #11728
Closed

do-expressions and nested breaks #11608

bakkot opened this issue May 25, 2020 · 5 comments · Fixed by #11728
Assignees
Labels
i: bug i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue Spec: Do Expressions

Comments

@bakkot
Copy link
Contributor

bakkot commented May 25, 2020

Bug Report

console.log(
  do {
    switch ("1") {
      case "1":
        if (true) {
          "out";
          break;
        }
    }
  }
);

console.log(
  do {
    x: {
      "out";
      break x;
    }
  }
);

This should print "out" twice. Instead it prints undefined twice.

@babel-bot
Copy link
Collaborator

Hey @bakkot! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@barronwei
Copy link
Contributor

Could I work on this?

@nicolo-ribaudo
Copy link
Member

Sure! If you need any help, feel free to ask here or on slack.

@barronwei
Copy link
Contributor

Looks like the conditional is causing the bug in the first case. Just to clarify, should the first case print "out" instead of 1, @bakkot?

@bakkot
Copy link
Contributor Author

bakkot commented Jun 15, 2020

@barronwei Yes, sorry. Edited the original post to fix it.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 19, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue Spec: Do Expressions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants