esprima icon indicating copy to clipboard operation
esprima copied to clipboard

Static property fails to parse

Open OndrejSpanel opened this issue 3 years ago • 1 comments

Steps to reproduce

Parse following code:

class ClassWithStaticMethod {
  static staticProperty = 'someValue';
}

The code fails to parse, this can be reproduced using https://esprima.org/demo/parse.html

Actual output

The error is:

Error: Line 2: Unexpected token =

Relevant references

The code is extracted from example https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static

OndrejSpanel avatar Feb 25 '22 11:02 OndrejSpanel

should work in esprima-next: https://github.com/node-projects/esprima-next

jogibear9988 avatar Feb 27 '22 11:02 jogibear9988