This was caused because the transformed AST was invalid when VariableDeclarator was wrapped because it returned an AssignmentExpression that was used as the variableDeclarator for a VariableDeclaration.
To be more specific it previously created nodes similar to this:
Followup on #167
This was caused because the transformed AST was invalid when VariableDeclarator was wrapped because it returned an AssignmentExpression that was used as the variableDeclarator for a VariableDeclaration.
To be more specific it previously created nodes similar to this:
which would never be created by any parser but
@babel/generator
is robust enough to handle it.Now we get a valid AST: