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
commit 32742709dc
Notes: sideshowbarker 2024-07-19 07:01:35 +09:00
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);
}