Skip to content

ES private field check #2311

@Danue1

Description

@Danue1

Describe the bug
ES private field check failed.

Input code

class Foo {
  static foo(foo) {
    return #foo in foo;
  }

  #foo = 'foo';
}

Config
default

Expected behavior
When lhs of "in" operator is a private identifier.

If there is a corresponding private field in the class definition, there is no error and it should be transpiled as it is.
If the corresponding private field does not exist in the class definition, an error should be raised that the corresponding private field in the class definition must exist.

Version
The version of @swc/core: 1.2.91

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions