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

Wrong handling of private Identifierers #354

Closed
jogibear9988 opened this issue Dec 25, 2022 · 3 comments · Fixed by #356
Closed

Wrong handling of private Identifierers #354

jogibear9988 opened this issue Dec 25, 2022 · 3 comments · Fixed by #356

Comments

@jogibear9988
Copy link
Contributor

Try this:

    class aa {
        #aa = true;
    }

We do not create an instance of PrivateIdentifier. We create a normal node with "#" in the value

jogibear9988 added a commit to jogibear9988/esprima-dotnet that referenced this issue Dec 25, 2022
@lahma
Copy link
Collaborator

lahma commented Dec 26, 2022

This should now be covered too.

@lahma lahma closed this as completed Dec 26, 2022
@adams85
Copy link
Collaborator

adams85 commented Dec 28, 2022

Unfortunately, not completely. Static private property and method declarations like

class X {
  static #privateField = 'super';
  static #getPrivateField() {
    return X.#privateField;
  }
}

are still parsed incorrectly as Identifiers. (Interestingly, static private getters/setters are handled correctly. Non-static private declarations are ok as well.)

@adams85 adams85 reopened this Dec 28, 2022
jogibear9988 added a commit to jogibear9988/esprima-dotnet that referenced this issue Dec 28, 2022
@jogibear9988
Copy link
Contributor Author

fixed in my pull, missed one parameter

lahma pushed a commit to jogibear9988/esprima-dotnet that referenced this issue Dec 29, 2022
lahma pushed a commit that referenced this issue Dec 29, 2022
* fix computed properties in classes
* throw an error when "arguments" is used as the value for a property (… 
* hacky fix some regex problems which occurred due to different parsers
* allow trailing "," in import
* allow trailing second "," in import
* throw error on deletion of private fields
* attributes on import could be a expression
* fix super access in methods
* many arguments is not invalid any more
* bugfix private static class members, fixes #354
* fix property access
* updated allow list
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

Successfully merging a pull request may close this issue.

3 participants