Skip to content

PrivateName should be migrated to PrivateIdentifier #1395

@btiernay

Description

@btiernay

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions