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

fix(es/compat): Generate OptCall for OptCall for private fields #8031

Merged
merged 3 commits into from
Sep 29, 2023

Conversation

Austaras
Copy link
Member

@Austaras Austaras commented Sep 29, 2023

@@ -400,7 +398,11 @@ impl VisitMut for Fixer<'_> {
fn visit_mut_call_expr(&mut self, node: &mut CallExpr) {
let old = self.visit_call(&mut node.args, &mut node.callee);
if let Callee::Expr(e) = &mut node.callee {
self.wrap_callee(e)
if let Expr::OptChain(_) = &**e {
self.wrap(e)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is unnecessary -- swc parser and paren_remover won't generate such structure, but it's better to be safe.

@kdy1 kdy1 added this to the Planned milestone Sep 29, 2023
@kdy1 kdy1 changed the title fix(es/compat: Generate OptCall for OptCall for private field fix(es/compat): Generate OptCall for OptCall for private fields Sep 29, 2023
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_ecma_transforms_compat

@kdy1 kdy1 enabled auto-merge (squash) September 29, 2023 19:27
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit 06b6eb9 into swc-project:main Sep 29, 2023
251 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.3.91 Oct 1, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Calling a private optional chained field fails with TypeError is not a function
3 participants