Closed GoodForOneFare closed 7 years ago
Previously, else if (foo = bar) would throw an exception because the transform tried to move the assignment to before the else. That would've created an invalid AST.
else if (foo = bar)
else
This updates the logic to rewrite else if (foo = bar) {} to
else if (foo = bar) {}
else { foo = bar; if (foo) { } }
Please review @lemonmade, @TylerHorth
@lemonmade please take another look. I've cleaned up indentation, and used path.replace instead of direct node assignment.
path.replace
Previously,
else if (foo = bar)
would throw an exception because the transform tried to move the assignment to before theelse
. That would've created an invalid AST.This updates the logic to rewrite
else if (foo = bar) {}
toPlease review @lemonmade, @TylerHorth