Skip to content

[Bug]: Await in a class decorator is not properly transpiled #16481

@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

@(await 1) 
class A {}

Configuration file name

No response

Configuration

decorators plugin on latest version

Current and expected behavior

It produces this code, but await in static blocks is not valid:

let _A;
class A {
  static {
    [_A, _initClass] = _applyDecs(this, [await 1], []).c;
  }
  static {
    _initClass();
  }
}

Environment

/

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Spec: DecoratorsoutdatedA 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