mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibJS: Multiple 'default' clauses in switch statement are a syntax error
This commit is contained in:
committed by
Andreas Kling
parent
57e7b2f8e4
commit
2dbea60fe2
Notes:
sideshowbarker
2024-07-19 01:50:55 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/2dbea60fe2c Pull-request: https://github.com/SerenityOS/serenity/pull/3795
@@ -68,3 +68,11 @@ describe("basic switch tests", () => {
|
||||
expect(i).toBe(5);
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("syntax errors", () => {
|
||||
expect("switch () {}").not.toEval();
|
||||
expect("switch (foo) { bar }").not.toEval();
|
||||
expect("switch (foo) { default: default: }").not.toEval();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user