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/decorators): Handle default exported class #8691

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

magic-akari
Copy link
Member

Copy link

changeset-bot bot commented Mar 4, 2024

⚠️ No Changeset found

Latest commit: 65960da

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -421,289 +421,273 @@ impl Decorator202203 {
new_class_name
}

fn handle_class_decl(&mut self, c: &mut ClassDecl) -> Option<Stmt> {
// This function will call `visit` internally.
fn handle_class_decl(&mut self, c: &mut ClassDecl) -> Stmt {
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 git diff is misleading.
There are minimal logical changes within this function.

  1. Change Option<Stmt> to Stmt
  2. All class.decorators.is_empty checks have been moved to the caller side.

@magic-akari magic-akari marked this pull request as ready for review March 4, 2024 09:38
@magic-akari magic-akari requested a review from a team as a code owner March 4, 2024 09:38
@kdy1 kdy1 self-assigned this Mar 4, 2024
@kdy1 kdy1 added this to the Planned milestone Mar 4, 2024
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_proposal

@kdy1 kdy1 enabled auto-merge (squash) March 4, 2024 10:36
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 570483a into swc-project:main Mar 4, 2024
141 of 142 checks passed
@magic-akari magic-akari deleted the fix/issue-8681 branch March 4, 2024 11:35
@kdy1 kdy1 modified the milestones: Planned, v1.4.3 Mar 5, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Apr 4, 2024
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.

Decorators not working correctly for default exported classes
3 participants