mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
LibJS: Handle continue in switch statement unwinding
This commit is contained in:
parent
8f54edb7a0
commit
f8886ef5ba
2 changed files with 20 additions and 1 deletions
|
@ -49,4 +49,22 @@ describe("basic switch tests", () => {
|
|||
expect(foo(42)).toBe("return from 'case 42'");
|
||||
expect(foo(43)).toBe("return from 'default'");
|
||||
});
|
||||
|
||||
test("continue from switch statement", () => {
|
||||
let i = 0;
|
||||
for (; i < 5; ++i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
continue;
|
||||
expect().fail();
|
||||
case 0:
|
||||
expect().fail();
|
||||
default:
|
||||
continue;
|
||||
expect().fail();
|
||||
}
|
||||
expect().fail();
|
||||
}
|
||||
expect(i).toBe(5);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue