Serenity: LibJS: Parse failure of if/else without curly braces

Created on 17 Apr 2020  路  6Comments  路  Source: SerenityOS/serenity

This fails to parse:

if (1) 
    return 1;
else
        return 0;
bug regression

Most helpful comment

I'll have a look. I bet it's something silly.

All 6 comments

Oh really? What does it say?

Oh really? What does it say?

Unexpected else. (I鈥檓 on my phone so can鈥檛 paste the exact error)

Syntax Error: Unexpected token Else. Expected statement (line: 3, column: 1)

Btw this _does_ parse & run correctly without semicolons:

if (1)
    return 1
else
    return 0

as well as

if (1)
    return 1
else
    return 0;

Yeah this broke with the semicolon insertion changes.

I'll have a look. I bet it's something silly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nvella picture nvella  路  7Comments

BenWiederhake picture BenWiederhake  路  6Comments

danboid picture danboid  路  6Comments

ZyorYT picture ZyorYT  路  6Comments

Quaker762 picture Quaker762  路  6Comments