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/minifier): Fix mapbox #3463

Merged
merged 9 commits into from Feb 7, 2022
Merged

fix(es/minifier): Fix mapbox #3463

merged 9 commits into from Feb 7, 2022

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Feb 7, 2022

Description:

swc_ecma_minifier:

  • mangler: Handle the identifiers of class expressions correctly.

image

As shown above, name mangler assigns i to a class expression and uses it again inside the class, as the name of a parameter.
This results in an exception from new i.


This is a fixed version.

image

(I copy-pasted it to js beutifier)

Related issue (if exists):

@kdy1 kdy1 added this to the v1.2.137 milestone Feb 7, 2022
@@ -1,4 +1,6 @@
function x() {
(class Baz {});
class Foo {}
(class a {
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 change is due to we didn't implement the option of terser to keep class names.

@kdy1 kdy1 requested a review from kwonoj February 7, 2022 04:22
@kdy1 kdy1 marked this pull request as ready for review February 7, 2022 04:22
@kdy1
Copy link
Member Author

kdy1 commented Feb 7, 2022

I'll merge it as code changes are quite trivial

@kdy1 kdy1 merged commit 0371c41 into swc-project:main Feb 7, 2022
@kdy1 kdy1 deleted the minifier-mapbox branch February 7, 2022 04:43
kodiakhq bot pushed a commit to vercel/next.js that referenced this pull request Feb 8, 2022
natew pushed a commit to natew/next.js that referenced this pull request Feb 16, 2022
@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 30, 2022
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.

None yet

1 participant