Skip to content

Conversation

@frodi-karlsson
Copy link
Contributor

@frodi-karlsson frodi-karlsson commented Mar 12, 2025

Fixes #540

@jakebailey jakebailey requested a review from rbuckton March 12, 2025 22:51
@jakebailey
Copy link
Member

This would probably benefit from an emit test (see the neighboring file for this transform),

@frodi-karlsson
Copy link
Contributor Author

@microsoft-github-policy-service agree

@frodi-karlsson
Copy link
Contributor Author

For some more context:

  • If there are no parameters, we return early on L804.
  • The nodes before pushing the constructor are { current: Parameter, parent: ClassDeclaration }
  • Pushing the constructor yields the class declaration, which we should then check for classness and all that

Copy link
Member

Choose a reason for hiding this comment

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

This to me seems like the evidence that this change is right.

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Checked with @rbuckton and there's apparently another cause to this.

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Checked with @rbuckton and there's apparently another cause to this.

@rbuckton
Copy link

There are two issues at play here. One is that visit has an early return when visiting modifiers on parameters and fails to call popNode, the other is that we don't need to call pushNode(constructor) in transformConstructorBody

@rbuckton
Copy link

I've put up the fix for these issues in #679

@jakebailey jakebailey closed this Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter properties in subclass constructor are assigned before the super() call

3 participants