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

Private Getters and Setters Throwing SyntaxError: Unexpected token #7

Open
jtwebb opened this issue Jun 8, 2021 · 3 comments
Open

Comments

@jtwebb
Copy link

jtwebb commented Jun 8, 2021

I've tried using this plugin directly and the stage3 plugin and both throw an error (SyntaxError: Unexpected token) for private getters and setters. I just have a simple example:

class MyClass {
  get #myMethod() {
    return 'hello';
  }
}

The error is thrown on the line of the getter declaration, right after the get keyword. Just to make sure I wasn't using it wrong, I cloned the repo and ran the tests and it looks like they're failing for the private getters and setters too. Has this feature been removed from the plugin?

Screen Shot 2021-06-08 at 11 39 36 AM

@kapouer
Copy link

kapouer commented Sep 27, 2021

Similar issue happen with private async methods:

class It {
 async #load() {
 }
}

@dnalborczyk
Copy link

dnalborczyk commented Oct 25, 2021

@jtwebb @kapouer

acorn includes this syntax directly now, no need to use this plugin. maybe it's causing an issue when used in tandem.

@dnalborczyk
Copy link

dnalborczyk commented Oct 25, 2021

@jtwebb just looking at the failing test cases:

accessing private fields without this is not allowed. private fields can also not be deleted. the spec probably changed after the current tests have been written.

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

3 participants