Skip to content

Linebreaks after 'get' or 'set' in class bodies are not parsed correctly (T7533) #4432

@babel-bot

Description

@babel-bot

Issue originally made by @bakkot

Input code

class A {
  get
    x(){}
}

Description

This code gives a parse error without the class-properties-transform plugin, and is parsed as a class containing a single method x with it. Neither is correct; it's valid syntax for a class with a getter (not method) for 'x'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions