BYVoid/continuation — pull request #6 by TomiBelan (2013-03-15 11:11:44+00:00)
Title: Refactor normalize() and fix transforming nested block statements

This does some refactoring, fixes issue #5 and a lot of other bugs as well.

The commit messages should be self-explanatory. If you want to read the diffs, I suggest reading them commit by commit instead of all at once in the "Files Changed" tab.

The first commit changes normalize() to use traverse() instead of calling normalize on child nodes manually. Some child nodes weren't being normalized, and many didn't pass on the "place" argument correctly. Plus, because only a few nodes actually need normalizing, this is also a lot less code. If I missed some disadvantages of this approach, please tell me.

The second commit removes the node.async properties and simply checks whether the transformed place is different instead. Some functions were setting async, some were checking the transform return value, some did both and some did neither. Now that there is a single thing to check, it should be easier to verify the code is correct.

I understand my patches are large and you might not have much time to spend on this project. So thanks for taking the time, and tell me if there's anything I can do to help. :-)