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 getters and setters and 'use strict' #264

Closed
tprk77 opened this issue Sep 10, 2015 · 3 comments
Closed

Comments

@tprk77
Copy link

tprk77 commented Sep 10, 2015

It seems that getters and setters 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 X {
  get x() {  }
  set x(val) {  }
}

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

Property 'x' already defined in this object literal.

@dgutov
Copy link
Collaborator

dgutov commented Sep 10, 2015

Thanks for the report.

@jacksonrayhamilton Could you check it out?

@jacksonrayhamilton
Copy link
Contributor

Sure, I'll take a look soon.

@tprk77
Copy link
Author

tprk77 commented Sep 11, 2015

Awesome, thanks guys!

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