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

"Property 'x' already defined" for static and instance class functions/fields and 'use strict' #534

Open
jacott opened this issue Sep 7, 2019 · 2 comments

Comments

@jacott
Copy link
Contributor

jacott commented Sep 7, 2019

Similar to issue #264 static and instance functions with the same name are being confused for the same property. . The error message is only shown in strict mode.

For example, given the following code in a js2-mode buffer:

'use strict';

class A {
  static x() { }
  x() { }

  static y = 1;
  y  = 2;
}

The x in x() { } will be highlighted red, and it will show the message:

Property 'x' already defined in this object literal. Same is true for y

@ArneBab
Copy link
Contributor

ArneBab commented Apr 28, 2021

Is this resolved? (I cannot reproduce it)

@dgutov
Copy link
Collaborator

dgutov commented Apr 28, 2021

Still reproduces here.

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