Skip to content

[Bug]: (Crash) Async arrow function with same parameter name under noNewArrow assumption #15170

@p51lee

Description

@p51lee

💻

  • Would you like to work on a fix?

How are you using Babel?

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

Input code

x = async x => 0 ;

Configuration file name

No response

Configuration

No response

Current and expected behavior

input.js is terminated normally:

$ node input.js # no error

but under noNewArrow assumption, Babel fails to transpile input.js:

By the way, when I used variable declaration instead of assignment expression, (var x = async x => 0) the transpilation terminates normally.

Environment

  • Babel version: 7.19.1
  • Node: v18.11.0
  • npm version: 8.19.2
  • OS: macos 12.4

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

i: regressionoutdatedA 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