Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect duplicate nodes during printing #18978

Open
amcasey opened this issue Oct 5, 2017 · 1 comment
Open

Detect duplicate nodes during printing #18978

amcasey opened this issue Oct 5, 2017 · 1 comment
Labels
Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Milestone

Comments

@amcasey
Copy link
Member

amcasey commented Oct 5, 2017

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.

@amcasey amcasey added the Suggestion An idea for TypeScript label Oct 5, 2017
@amcasey
Copy link
Member Author

amcasey commented Oct 5, 2017

FYI @mhegazy @sandersn

@mhegazy mhegazy added the Infrastructure Issue relates to TypeScript team infrastructure label Oct 9, 2017
@RyanCavanaugh RyanCavanaugh added the Experience Enhancement Noncontroversial enhancements label Aug 22, 2018
@RyanCavanaugh RyanCavanaugh added this to the Future milestone Aug 22, 2018
@weswigham weswigham added the In Discussion Not yet reached consensus label Nov 6, 2018
@RyanCavanaugh RyanCavanaugh removed In Discussion Not yet reached consensus Infrastructure Issue relates to TypeScript team infrastructure labels Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants