mooz / js2-mode

Improved JavaScript editing mode for GNU Emacs
GNU General Public License v3.0
1.33k stars 186 forks source link

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

Open jacott opened 5 years ago

jacott commented 5 years ago

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 commented 3 years ago

Is this resolved? (I cannot reproduce it)

dgutov commented 3 years ago

Still reproduces here.