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

[ts] Allow ...<...> followed by newline or binary operator #14636

Merged
merged 1 commit into from Jun 16, 2022

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Jun 2, 2022

Q                       A
Fixed Issues? Ref microsoft/TypeScript#49353
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

I'm marking this PR as a draft until the TS PR is merged with the final syntax rules.

@nicolo-ribaudo nicolo-ribaudo added PR: Spec Compliance 👓 A type of pull request used for our changelog categories pkg: parser area: typescript labels Jun 2, 2022
// a<b>
// if (0);
// is not valid TS code (https://github.com/microsoft/TypeScript/issues/48654)
// However, it should correctly parse anything that is correctly parsed by TS.
Copy link
Member Author

Choose a reason for hiding this comment

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

The linked issue has been fixed.

@babel-bot
Copy link
Collaborator

babel-bot commented Jun 2, 2022

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

@nicolo-ribaudo nicolo-ribaudo changed the title [ts] Allow ...<...> followed by newline and strict keyword [ts] Allow ...<...> followed by newline or binary operator Jun 10, 2022
// a<b>c is (a<b)>c
(tokenType !== tt.parenL &&
tokenCanStartExpression(tokenType) &&
!this.hasPrecedingLineBreak())
Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -9,36 +9,40 @@
"body": [
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if these changes are correct; I asked to the TS team.

Copy link
Member Author

Choose a reason for hiding this comment

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

@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review June 11, 2022 13:32
@nicolo-ribaudo nicolo-ribaudo merged commit 2ca44e4 into babel:main Jun 16, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the ts-inst-expr-kw-nl branch June 16, 2022 07:19
nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this pull request Jun 18, 2022
@JLHwung JLHwung mentioned this pull request Jul 21, 2022
1 task
@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 16, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Spec Compliance 👓 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

5 participants