Skip to content

The test of ConditionalExpression can not be an unparenthesized ArrowExpression #1428

@JLHwung

Description

@JLHwung
() => {} ? 1 : 0

Expected: Acorn throws syntax error. This is invalid per https://tc39.es/ecma262/#prod-AssignmentExpression, the test of a ConditionalExpression is a ShortCircuitExpression, which does not cover ArrowFunctionExpression.

Acutal: It parses successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions