1
Fork 0
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:
Linus Groh 2020-05-03 10:59:00 +01:00 committed by Andreas Kling
parent 3b432eed98
commit 32742709dc
3 changed files with 23 additions and 4 deletions

View 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);
}