Skip to content

fix(44639): Transpilation of optional chaining combined with type casting results in function call losing its context #44666

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

Merged
merged 4 commits into from
Nov 29, 2021

Conversation

a-tarasyuk
Copy link
Contributor

Fixes #44639

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Jun 19, 2021
@rbuckton
Copy link
Contributor

I should be able to merge this shortly.

@weswigham: Can you take a quick look at the changes in d7d0434 since this changes something you fixed a few years ago?

@rbuckton rbuckton requested a review from weswigham November 11, 2021 00:56
@rbuckton
Copy link
Contributor

@DanielRosenwasser, @andrewbranch: Should we take this for 4.5? If so, I can cherry pick once this is merged.

Copy link
Contributor

@rbuckton rbuckton left a comment

Choose a reason for hiding this comment

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

Looks good, though I'd like to get a review from someone else on the TS team for my changes in emitter.ts and ts.ts around ASI and comment handling.

@andrewbranch
Copy link
Member

I think this should target 4.6 at this point.

@rbuckton rbuckton merged commit d3d088f into microsoft:main Nov 29, 2021
mprobst pushed a commit to mprobst/TypeScript that referenced this pull request Jan 10, 2022
…ting results in function call losing its context (microsoft#44666)

* fix(44639): Fix emit for optional chain with type assertions

* Move ASI-blocking parens out of ts transform

* Add missing comments from PartiallyEmittedExpression+minor cleanup

* Avoid comment duplication on copied receiver

Co-authored-by: Ron Buckton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Transpilation of optional chaining combined with type casting results in function call losing its context
5 participants