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

@__KEY__: Correctly copy annotations when cloning AST_string #1375

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

jpdutoit
Copy link
Contributor

@jpdutoit jpdutoit commented Apr 13, 2023

I noticed that in some rare cases, Terser does not mangle a @__KEY__ annotated string literal.

I traced this to the annotations not being copied in the AST_String constructor.

It is not clear to me when Terser decides to clone a node, so I wasn't able to construct a minimal test case for this. But testing on a real code-base showed that this change does fix the issue.

@fabiosantoscode
Copy link
Collaborator

Nice catch!

@fabiosantoscode fabiosantoscode merged commit 94ae068 into terser:master Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants