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

RegularExpressionLiteral parse incorrect #52

Closed
noootwo opened this issue Nov 22, 2024 · 1 comment · Fixed by #53
Closed

RegularExpressionLiteral parse incorrect #52

noootwo opened this issue Nov 22, 2024 · 1 comment · Fixed by #53

Comments

@noootwo
Copy link

noootwo commented Nov 22, 2024

/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
This case will be parsed to /^[a-zA-Z0-9.!#$%&'*+/ and something else.

But it can be correctly identified in javascript runtime.

lydell added a commit that referenced this issue Nov 22, 2024
You can put `[/]` in a regex without escaping the slash: `/[/]/`.

js-tokens already knew about that, but there were only tests for that
situation at the very beginning of regexes. `/a[/]/` would fail to be
parsed correctly, since `a[` would be eagerly consumed by part of the
regex literal regex.

Closes #52.
@lydell
Copy link
Owner

lydell commented Nov 22, 2024

Fix released in v9.0.1.

Thank you for reporting!

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

Successfully merging a pull request may close this issue.

2 participants