Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

RegExpLiteral is not converted to Literal in an edge case #838

@futpib

Description

@futpib

Broken example:

> require('babel-eslint').parse('1 * /a/').body[0].expression.right.type
'RegExpLiteral'

Changing * to + makes babel-eslint behave properly:

> require('babel-eslint').parse('1 + /a/').body[0].expression.right.type
'Literal'

Version:

$ npm list babel-eslint
eslint-template-visitor@2.1.1 /home/futpib/code/eslint-template-visitor
└── babel-eslint@10.1.0

Of course no one writes x * /a/, but this bug breaks my fuzzing test.

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