Skip to content

[Bug]: Wrong ASI in class fields when TS plugin is enabled #16759

@nicolo-ribaudo

Description

@nicolo-ribaudo

💻

  • Would you like to work on a fix?

How are you using Babel?

Other (Next.js, Gatsby, vue-cli, ...)

Input code

class A {
  static
  foo = 2
}

Configuration file name

No response

Configuration

No response

Current and expected behavior

When the typescript plugin is enabled we parse that class as having a field named static and one named foo. When it's not enabled, we parse it as a class having a static field named foo.

The second behavior is correct, and enabling the TS plugin should not change it.

Environment

Babel 7.25.0

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions