An original function (a function that was in the original code) should be transformed separately from the code it's in. If the outside code uses try/catch, neither the function, nor the continuations that are generated inside it, should be affected. (Tell me if I should go into more detail. It might not be clear this is correct.)
This builds on your work made in 7e2627e4ea8110ce36e72ab3d8fdf999d00a08bb to fix my modified test case and also adds that as a new unit test.
Note: Though traverse() is also used elsewhere, notably in WhileStatement and SwitchStatement, and they don't use currentScope: true, I wasn't able to find a bug analogous to #4 for them. I think those traverse() calls don't need changing.
An original function (a function that was in the original code) should be transformed separately from the code it's in. If the outside code uses try/catch, neither the function, nor the continuations that are generated inside it, should be affected. (Tell me if I should go into more detail. It might not be clear this is correct.)
This builds on your work made in 7e2627e4ea8110ce36e72ab3d8fdf999d00a08bb to fix my modified test case and also adds that as a new unit test.
Note: Though
traverse()
is also used elsewhere, notably in WhileStatement and SwitchStatement, and they don't usecurrentScope: true
, I wasn't able to find a bug analogous to #4 for them. I think thosetraverse()
calls don't need changing.