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 👓 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

@nicolo-ribaudo nicolo-ribaudo Jun 2, 2022

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

@nicolo-ribaudo nicolo-ribaudo Jun 10, 2022

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

@nicolo-ribaudo nicolo-ribaudo Jun 10, 2022

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

@nicolo-ribaudo nicolo-ribaudo Jun 11, 2022

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 Jun 11, 2022
@nicolo-ribaudo nicolo-ribaudo merged commit 2ca44e4 into babel:main Jun 16, 2022
35 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the ts-inst-expr-kw-nl branch Jun 16, 2022
nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this issue Jun 18, 2022
@JLHwung JLHwung mentioned this pull request Jul 21, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: typescript pkg: parser PR: Spec Compliance 👓
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants