Skip to content

tokenizer fails on an await expression containing a regexp #989

Open
@ascidian

Description

@ascidian

Tokenizer fails the following test while the parser works fine.

async function f(){ await /a*/; }

It appears to interpret as { (await / a) * /;, } leading to an unterminated regexp error.

To reproduce:
node acorn/dist/bin.js --ecma2020 --tokenize <test-file.js>

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