Visitar URL original
fix(`@babel/parser`): fix tokenizer context update code by Eyoatam 路 Pull Request #13422 路 babel/babel 路 GitHub
Skip to content

fix(@babel/parser): fix tokenizer context update code - #13422

Merged
JLHwung merged 2 commits into
babel:mainfrom
Eyoatam:main
Jun 8, 2021
Merged

JLHwung merged 2 commits into
babel:mainfrom
Eyoatam:main

Conversation

@Eyoatam

@Eyoatam Eyoatam commented Jun 4, 2021 •

Copy link
Copy Markdown
Contributor
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
Copy Markdown
Collaborator

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

@codesandbox-ci

codesandbox-ci Bot commented Jun 4, 2021

Copy link
Copy Markdown

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

@JLHwung JLHwung left a comment

Copy link
Copy Markdown
Contributor

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.

@JLHwung JLHwung left a comment

Copy link
Copy Markdown
Contributor

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

JLHwung commented Jun 7, 2021

Copy link
Copy Markdown
Contributor

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.

4 participants