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

Improve errors location tracking #14130

Commits on Jan 17, 2022

  1. Have raise() take a Position instead of an integer index so that we c…

    …an correctly and efficiently track line and column offsets. Additionally:
    
    1. Make Errors.ElementAfterRest a recoverable error.
    2. Make expectContextual throw a nicer error telling you what it expected to find.
    
    Reviewed by @tolmasky.
    tolmasky committed Jan 17, 2022
    Copy the full SHA
    57d6e98 View commit details
    Browse the repository at this point in the history
  2. Update test results to reflect that Errors.ElementAfterRest is now re…

    …coverable, and that expectedContextual now throws an error message with the expected token. Also, update `packages/babel-parser/test/fixtures/es2015/uncategorised/277/input.js` since it had a different syntax error that was previously not reached since it would first fail on the fact that there was an element after rest.
    
    Reviewed by @tolmasky.
    tolmasky committed Jan 17, 2022
    Copy the full SHA
    65b7aae View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    2d355b4 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    42ebf70 View commit details
    Browse the repository at this point in the history
  5. Make checkExpressionErrors return whether it has errors again, but we…

    … should look into this more.
    
    Reviewed by @tolmasky.
    tolmasky committed Jan 17, 2022
    Copy the full SHA
    3014752 View commit details
    Browse the repository at this point in the history
  6. Use a WeakMap to associate indexes to Positions until we decide wheth…

    …er to make index an actual property in the next minor release.
    
    Reviewed by @tolmasky.
    tolmasky committed Jan 17, 2022
    Copy the full SHA
    22d3112 View commit details
    Browse the repository at this point in the history