Open NeeEoo opened 3 weeks ago
why did it need to have first vsriable anyway
A test would be good!
It looks like you just changed the order of the elements in the "or" clause:
while (cond or _hx_do_first_x)
to
while(_hx_do_first_x or cond)
What's the reason why the order matters?
It looks like you just changed the order of the elements in the "or" clause:
while (cond or _hx_do_first_x)
to
while(_hx_do_first_x or cond)
What's the reason why the order matters?
Because if the loop expression depends on something to be changed in the loop it breaks.
Basically it doesn't need to run the conditional expression, thus if the expression has code that depends on one iteration of the loop to run then it wont crash.
Do while loops in other languages only runs the conditional expression after the loop has run once, and if it returns true it goes back to the beginning. Replicating this behavior on lua means the _hx_do_first_x
has to be at the start, so the entire condition doesn't run.
This seems like it might be unspecified behavior. I think a test would be a good idea to make sure the other targets have the same behavior. If all targets work the same I think it's a good change.
This fixes an issue where
would crash