Skip to content

[Bug]: Babel crashes when using await as an identifier in ForInOfHead #15127

Description

@p51lee

💻

  • Would you like to work on a fix?

How are you using Babel?

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

Input code

for( await of [1, 2, 3] )  { console.log(await) }

Configuration file name

No response

Configuration

No response

Current and expected behavior

Hello,

The input code prints 1, 2 and 3:

$ node --version
v18.11.0
$ node input.js
1
2
3

However, Babel fails to transpile the input code:
image

Environment

Reproduction on Babel's own REPL

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions