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

Note AST mutation #61

Open
forresto opened this issue Apr 6, 2021 · 1 comment
Open

Note AST mutation #61

forresto opened this issue Apr 6, 2021 · 1 comment

Comments

@forresto
Copy link

forresto commented Apr 6, 2021

It should be noted in the Readme that acornGlobals(ast) will mutate ast, adding array of parents to Identifier nodes. These unexpected properties might trip folks that are walking the AST after running acornGlobals.

Alternatively, acornGlobals could deep clone the input, to avoid mutating it.

@ForbesLindesay
Copy link
Owner

ForbesLindesay commented Aug 31, 2022

We don't currently document the approach of passing in an AST node - we only document passing in a string. I would accept a PR to add documentation for the AST based approach to the README though (along with documenting the above caveat).

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

No branches or pull requests

2 participants