dynjs/dynjs — pull request #21 by jingweno (2012-07-22 02:30:17+00:00)
Title: [DYNJS-59] Fix bug related to unary operation in for loop.

The problem is due to in unary operation statement, local var is pushed to stack for consequent operation, we need to remove it from the stack otherwise for loop will throw [exception](https://gist.github.com/3148773).

The [aload(4)](https://github.com/dynjs/dynjs/blob/master/src/main/java/org/dynjs/parser/statement/AbstractUnaryOperationStatement.java#L50) in `AbstractUnaryOperationStatement` seems to be used to load the snapshot variable to the stack for consequent operation, e.g. `var x = 0; x++ == 0`.

Warning: this may not be a clean fix since I think a better fix would be to fix `AbstractUnaryOperationStatement` that it only loads the snapshot variable when there is consequent operation. But it doesn't seem to have enough information to decide it.