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

PrivateName should be migrated to PrivateIdentifier #1395

Open
btiernay opened this issue Mar 13, 2024 · 0 comments
Open

PrivateName should be migrated to PrivateIdentifier #1395

btiernay opened this issue Mar 13, 2024 · 0 comments

Comments

@btiernay
Copy link

btiernay commented Mar 13, 2024

Per the ESTree specification, PrivateName should should be PrivateIdentifier
image

This will ensure interoperability with other parsers such as esprima-next. Currently the following pre-walk of the raw AST is required:

            // We need to fix the AST to match the expected format of recast (i.e. ast-types)
            const vistitor = new class extends Visitor {
                visitPrivateIdentifier(node) {
                    node.type = 'PrivateName'
                    return super.visitPrivateIdentifier(node);
                }
            }

            vistitor.visit(ast);

See estree/estree#240 for further details.

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

1 participant