mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:48:11 +00:00
LibJS: Support empty statements
We already skipped random semicolons in Parser::parse_program(), but now they are properly matched and parsed as empty statements - and thus recognized as a valid body of an if / else / while / ... statement.
This commit is contained in:
parent
3b432eed98
commit
32742709dc
3 changed files with 23 additions and 4 deletions
11
Libraries/LibJS/Tests/empty-statements.js
Normal file
11
Libraries/LibJS/Tests/empty-statements.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
try {
|
||||
;;;
|
||||
if (true);
|
||||
if (false); else if (false); else;
|
||||
while (false);
|
||||
do; while (false);
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue