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(@babel/parser
): fix tokenizer context update code
#13422
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/46691/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 42d35a8:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! We should add a test for this change.
While it is very likely to be a typo, I think we should add a test to actually cover this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not visible to users.
Before this PR, the first slash in { function x () {} /1/ }
is tokenized as a slash (incorrect!) but later we are saved from the parser#parseExprAtom
where we re-read as a regex token:
if (this.state.type === tt.slash) this.readRegexp(); |
After this PR, such token is handled as regexp token in the first place. So this PR does not introduce changing behaviours.
I marked this PR as internal because of no visible behaviour changes. |
this will always be false since
b_stat
does not exist on thetypes
object. so instead oftypes.b_stat
usetypes.braceStatement