1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

LibJS: Fix parsing of IfStatement, fixes #1829

This commit is contained in:
Stephan Unverwerth 2020-04-18 14:00:43 +02:00 committed by Andreas Kling
parent 3072f9fd82
commit cebb619f8e
2 changed files with 23 additions and 1 deletions

View file

@ -5,6 +5,25 @@ load("test-common.js");
* If this file produces syntax errors, something is wrong.
*/
function bar() {
// https://github.com/SerenityOS/serenity/issues/1829
if (1)
return 1;
else
return 0;
if (1)
return 1
else
return 0
if (1)
return 1
else
return 0;
}
function foo() {
for (var i = 0; i < 4; i++) {
break // semicolon inserted here