mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibJS: Implement basic execution of "switch" statements
The "break" keyword now unwinds to the nearest ScopeType::Breakable. There's no support for break labels yet, but we'll get there too.
This commit is contained in:
parent
1923051c5b
commit
2285f84596
Notes:
sideshowbarker
2024-07-19 08:04:58 +09:00
Author: https://github.com/awesomekling
Commit: 2285f84596
6 changed files with 57 additions and 2 deletions
10
Libraries/LibJS/Tests/switch-basic.js
Normal file
10
Libraries/LibJS/Tests/switch-basic.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
switch (1 + 2) {
|
||||
case 3:
|
||||
console.log("PASS");
|
||||
break;
|
||||
case 5:
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue