Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokenizer fails on an await expression containing a regexp #989

Open
ascidian opened this issue Oct 11, 2020 · 1 comment
Open

tokenizer fails on an await expression containing a regexp #989

ascidian opened this issue Oct 11, 2020 · 1 comment

Comments

@ascidian
Copy link

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>

@RReverser
Copy link
Member

Note that tokenizer will never match what a full parser can, even though it's pretty close.

But in this instance, I think, we should be able to modify tokencontext.js to handle async-await in a similar way that it already handles generators & yield.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants