Skip to content

fix(babel-parser): Fix end of range of SequenceExpression#13731

Merged
nicolo-ribaudo merged 3 commits into
babel:mainfrom
sosukesuzuki:fix-sequence-expr-range-end
Sep 4, 2021
Merged

fix(babel-parser): Fix end of range of SequenceExpression#13731
nicolo-ribaudo merged 3 commits into
babel:mainfrom
sosukesuzuki:fix-sequence-expr-range-end

Conversation

@sosukesuzuki

@sosukesuzuki sosukesuzuki commented Sep 3, 2021

Copy link
Copy Markdown
Contributor
Q                       A
Patch: Bug Fix? Y
Tests Added + Pass? Y
License MIT

Caused by #13521.

range[1] of SequenceExpression is 1 more than expected.

@babel-bot

babel-bot commented Sep 3, 2021

Copy link
Copy Markdown
Collaborator

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

this.finishNode(val, "SequenceExpression");
val.end = innerEndPos;
val.loc.end = innerEndLoc;
if (this.options.ranges) val.range[1] = innerEndPos;

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.

We can call resetEndLocation on val.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 6f2ae6c

@sosukesuzuki sosukesuzuki force-pushed the fix-sequence-expr-range-end branch from b26abde to 6f2ae6c Compare September 4, 2021 09:23
@codesandbox-ci

codesandbox-ci Bot commented Sep 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 6f2ae6c:

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

@nicolo-ribaudo nicolo-ribaudo merged commit 62e42a3 into babel:main Sep 4, 2021
@nicolo-ribaudo

Copy link
Copy Markdown
Member

The CI failure is not related

@sosukesuzuki sosukesuzuki deleted the fix-sequence-expr-range-end branch September 4, 2021 10:04
@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 Dec 5, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 5, 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: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants