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(@babel/parser): fix tokenizer context update code #13422

Merged
merged 2 commits into from Jun 8, 2021
Merged

Conversation

Eyoatam
Copy link
Contributor

@Eyoatam Eyoatam commented Jun 4, 2021

Q                       A
Patch: Bug Fix? Yes
Tests Added + Pass? Yes
License MIT

this will always be false since b_stat does not exist on the types object. so instead of types.b_stat use types.braceStatement

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/46691/

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 4, 2021

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:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

JLHwung
JLHwung previously approved these changes Jun 4, 2021
Copy link
Contributor

@JLHwung JLHwung left a 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.

@existentialism existentialism added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: types labels Jun 4, 2021
@JLHwung JLHwung dismissed their stale review June 7, 2021 15:17

While it is very likely to be a typo, I think we should add a test to actually cover this branch.

Copy link
Contributor

@JLHwung JLHwung left a 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.

@JLHwung JLHwung added PR: Internal 🏠 A type of pull request used for our changelog categories and removed PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Jun 7, 2021
@JLHwung
Copy link
Contributor

JLHwung commented Jun 7, 2021

I marked this PR as internal because of no visible behaviour changes.

@JLHwung JLHwung merged commit 56db172 into babel:main Jun 8, 2021
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants