-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
While rewriting code for refactorings and code fixes, it is quite easy to inadvertently insert a single Node into multiple positions in the tree (i.e. when it should have been cloned). It would be very helpful if the printer (or other, more appropriate, component) detected this, rather than behaving subtly incorrectly or throwing an (apparently) unrelated exception.
One way to do this would be to clear __pos and __end before traversing the tree and then throwing if they are set a second time during the traversal.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsSuggestionAn idea for TypeScriptAn idea for TypeScript