[Moved] Bug: Printing if statement inside bracketless if-else
adiba opened this issue · comments
adiba commented
This
recast.print(
b.ifStatement(
b.literal(1), // test
b.ifStatement( // consequent
b.literal(2), // - test
b.expressionStatement(b.literal(3)) // - consequent
),
b.expressionStatement(b.literal(4)) // alternate
)
).code
produces:
if (1)
if (2)
3;
else
4;
but should produce this:
if (1)
{
if (2)
3;
} else
4;
moved to benjamn/recast#416