question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

do-expressions and nested breaks

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bakkotcommented, Jun 15, 2020

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

1reaction
nicolo-ribaudocommented, Jun 12, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking out of nested for loop - Stack Overflow
I know there is an answer for how to break out of a for loop, but I'm still having trouble breaking out of...
Read more >
Which loop does 'break' exit in nested for loops in C ... - Quora
In a nested set of loops, a break will only break out of the loop that contains the break. If you want to...
Read more >
7.10 Break and Continue Statements | Stan Reference Manual
Although break and continue must appear within loops, they may appear in nested statements within loops, such as within the conditionals shown above...
Read more >
[SI204: AY21] Class 11: For loops, break, nested loops
Note: in the case of nested loops, break only "breaks out of" the innermost of the loops in which it appears.
Read more >
Module Nine Lesson Two Practice Activity - Deepnote
Differentiate between break and continue statements; Control loop iteration using break or continue; Use nested loops to iterate over the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found