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

fix: missing flag from regex literal in corner case #529

Merged
merged 1 commit into from
Jul 9, 2024

Commits on Jul 8, 2024

  1. Fix missing flag from regex literal in corner case

    In the specific corner case where a regex contains a flag but is not
    followed by any symbols, the ast.RegExpLiteral.Literal value would drop
    (part of) that flag.
    
    This happens because the p.next() call during the parsing of the flag
    wouldn't actually advance the p.chrOffset, and thus endOffset would be
    erroneously adjusted.
    
    The fix is just to use the current p.chrOffset and then call p.next()
    afterwards.
    psve committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    f2e254a View commit details
    Browse the repository at this point in the history