Skip to content

Static property fails to parse #2111

@OndrejSpanel

Description

@OndrejSpanel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions