-
Notifications
You must be signed in to change notification settings - Fork 709
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
jscodeshift.registerMethods should be idempotent #22
Comments
Thanks for pointing that out! Not sure how to get a fresh copy since that's not how modules work, but maybe we can expose some API to clear the registered methods. |
yeah, if it's not running in an iframe it's tough. If the result runs in an iframe then you could just load it anew every time. Otherwise, either a clear api or a "i know i'm overwriting methods" option to |
Added a hack to prevent errors on jscodeshift.registerMethods when editing, while still throwing on duplicates within same run.
Thanks @RReverser and @fkling |
If I include a jscodeshift.registerMethods in my transform, it works the first time, but if I change the transform, I get an error:
I'd expect a fresh jscodeshift w/ no methods registered each iteration.
Repro: http://felix-kling.de/esprima_ast_explorer/#/NvHouJt2GJ
Just open it, and make a change to the transform.
The text was updated successfully, but these errors were encountered: