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

Make the use of lexical_names::DuplicateNameDetector optional #69

Open
FreeMasen opened this issue Nov 18, 2021 · 1 comment
Open

Make the use of lexical_names::DuplicateNameDetector optional #69

FreeMasen opened this issue Nov 18, 2021 · 1 comment

Comments

@FreeMasen
Copy link
Collaborator

I had initially added this to try and reach a fulling passing test262 based test, however validation is something that should be left up to the consumer of the AST. Ideally we could allow this to be provided by the constructor, similar to the how the comment handling works.

In the ideal case, users could completely opt out of the validation if they have already validate the javascript using some external tool, for example they are interacting with js that has already been passed through webpack or similar.

@azw413
Copy link

azw413 commented Nov 22, 2021

It might need to be more fine-grained than that, since users may want most validation but perhaps to relax one or two rules. Maybe one option might be to have a trait defining each validation rule in a default implementation. If users want to relax one or more rules or perhaps even make existing rules stricter then they could implement the trait and change the default implementation for one or more rules. Maybe then the parser constructor will optionally take an implementation as a parameter to customise the implementation if required.

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