Skip to content

[Bug]: computed class keys are not transformed by @babel/plugin-proposal-async-generator-functions #14347

@clhiker

Description

@clhiker

💻

  • Would you like to work on a fix?

How are you using Babel?

@babel/cli

Input code

async function* fn() {
  class A {
    [yield 1]() {}
  }

  class B extends A {
    [await 1]() {}
  }
}

Here is REPL

Configuration file name

babel.config.json

Configuration

{
  "sourceType": "unambiguous",
  "presets": ["@babel/preset-env"],
  "plugins": [
    "@babel/plugin-transform-runtime"
  ]
}

Current and expected behavior

After being transformed by babel, there is a bug run by node

SyntaxError: missing ) after argument list

Environment

  • babel
    • ├── @babel/cli@7.17.0=6
    • ├── @babel/generator@7.17.3
    • ├── @babel/plugin-transform-runtime@7.17.0
    • ├── @babel/preset-env@7.16.11
  • Node: [v17.3.0]
  • npm version [8.5.2]
  • os [ubuntu 20.04]

Possible solution

No response

Additional context

I run babel use cmd as follows

npx babel poc.js -o res/poc.js

Metadata

Metadata

Assignees

Labels

Spec: Async GeneratorsoutdatedA 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