mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 10:12:25 -05:00
ababcc5725
When we encounter a default clause in a switch statement, we should not execute it immediately, instead we need to wait until all case clauses have been executed as a matching case clause can break from the switch/case. The code is nowhere close to the spec, so instead of fixing it properly I just made it slightly worse, but correct. Needs a complete refactor at some point.
9 lines
191 B
JavaScript
9 lines
191 B
JavaScript
test("default clause before matching case clause", () => {
|
|
switch (1 + 2) {
|
|
default:
|
|
expect().fail();
|
|
break;
|
|
case 3:
|
|
return;
|
|
}
|
|
});
|