Skip to content

export default async function parsed as FunctionExpression #3264

@danez

Description

@danez

Input Code

export async function foo() {}
export default async function bar() {}

see https://astexplorer.net/#/QbgcqufEk7

The second line should be parsed as an ExportDefaultDeclaration and a FunctionDeclaration, but it is a FunctionExpression.

A named export with a function declaration leads to FunctionDeclaration whenever it's regular, async or generator function, a default export leads to FunctionDeclaration when regular or generator, but to FunctionExpression when async.

copied from babel/babylon#257
fixed in babylon with babel/babylon#324

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions