Skip to content

[Bug]: Babel misinterprets function𝐬 as function keyword after async #13339

@JLHwung

Description

@JLHwung

💻

  • Would you like to work on a fix?

How are you using Babel?

@babel/cli

Input code

// snippet 1
async function𝐬 f() {}
// snippet 2
async function𝐬 => {}

Configuration file name

package.json

Configuration

N.A.

Current and expected behavior

Snippet 1 is invalid and the parser should throw.
Snippet 2 is valid but the parser throws "unexpected token" on =>.

Environment

REPL

Possible solution

We should examine how we detect the pattern async function in

isAsyncFunction(): boolean {

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions