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): Handle shorthand object prop when rename #7176

Merged
merged 3 commits into from
Mar 31, 2023

Conversation

magic-akari
Copy link
Member

Description:

BREAKING CHANGE:

Related issue (if exists):

Verified

This commit was signed with the committer’s verified signature.
@magic-akari magic-akari changed the title fix(es/compat): Handle Shorthand prop when rename fix(es/compat): Handle shorthand prop when rename Mar 30, 2023
@magic-akari magic-akari changed the title fix(es/compat): Handle shorthand prop when rename fix(es/compat): Handle shorthand object prop when rename Mar 30, 2023

Verified

This commit was signed with the committer’s verified signature.
@@ -26,6 +26,26 @@ impl VisitMut for Rename {
}
}

fn visit_mut_prop(&mut self, n: &mut Prop) {
let span = n.span();
if span.ctxt == SyntaxContext::empty() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Should I omit this check logic?

Copy link
Member

Choose a reason for hiding this comment

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

I think this logic can cause a problem

Copy link
Member

Choose a reason for hiding this comment

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

Why did you add this logic?

Copy link
Member Author

Choose a reason for hiding this comment

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

To skip prop which generated by ourselves.
I noticed that it's the reason caused the test result change.
I will correct it.

c: (b) => {
const x: number = b;
}

@magic-akari magic-akari marked this pull request as ready for review March 30, 2023 16:30
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

@@ -26,6 +26,26 @@ impl VisitMut for Rename {
}
}

fn visit_mut_prop(&mut self, n: &mut Prop) {
let span = n.span();
if span.ctxt == SyntaxContext::empty() {
Copy link
Member

Choose a reason for hiding this comment

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

I think this logic can cause a problem

@@ -26,6 +26,26 @@ impl VisitMut for Rename {
}
}

fn visit_mut_prop(&mut self, n: &mut Prop) {
let span = n.span();
if span.ctxt == SyntaxContext::empty() {
Copy link
Member

Choose a reason for hiding this comment

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

Why did you add this logic?

@kdy1 kdy1 added this to the Planned milestone Mar 31, 2023

Verified

This commit was signed with the committer’s verified signature.
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.

Thank you!

@kdy1 kdy1 enabled auto-merge (squash) March 31, 2023 02:50
@kdy1 kdy1 merged commit 0a80e05 into swc-project:main Mar 31, 2023
@magic-akari magic-akari deleted the fix/issue-7174 branch March 31, 2023 07:08
@kdy1 kdy1 modified the milestones: Planned, v1.3.45 Apr 4, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators May 4, 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.

props key of window is transformed
2 participants