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

Mangle function name duplicate with parameter names #9015

Closed
chinalichen opened this issue Jun 3, 2024 · 3 comments · Fixed by #9029
Closed

Mangle function name duplicate with parameter names #9015

chinalichen opened this issue Jun 3, 2024 · 3 comments · Fixed by #9029
Assignees
Labels
Milestone

Comments

@chinalichen
Copy link

Describe the bug

output code:

runOnce(function e(e,c=0){});

Run this in Safari (iOS 16.1.1) throw error:
image

Works in chrome and latest safari.

Input code

runOnce(function dup_func(dup_param, offset = 0) {})

Config

{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": false
    },
    "target": "es2015",
    "loose": false,
    "minify": {
      "compress": false,
      "mangle": true
    }
  },
  "module": {
    "type": "es6"
  },
  "minify": true,
  "isModule": false
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.5.24&code=H4sIAAAAAAAAAytKTc8sLkkt0kgrzUsuyczPU0gpLcjJTE4sSY0HCWkguAWJRYm5Ogr5aWnFqSUKtgoGmgrVtZpcACgasG1CAAAA&config=H4sIAAAAAAAAA1WPSwrDMAxE9zmF0bqLttAueocewrhKcPAPS4GGkLvH33521sw8j7QNQsBMCh5iS880BBkJ42dOCq2O5TspgMpKUlEHhlN3Z8rWKA1hkfbqAMs4IReKrufLrRFgvCfsRNOsdnpcfzuVtyEi0X8wR6WbTOY5Lq1waKVg%2FWspXjuF14B1gTt8Q70rf1AUTc8O1jP2A%2BC7qlwWAQAA

SWC Info output

No response

Expected behavior

runOnce(function n(e,c=0){});

Actual behavior

runOnce(function n(n,c=0){});

Version

1.5.24

Additional context

No response

@Austaras
Copy link
Member

Austaras commented Jun 3, 2024

Note: this seems to be Safari only bug.

@Austaras
Copy link
Member

Austaras commented Jun 3, 2024

But we should rename the function name anyway.

@swc-bot
Copy link
Collaborator

swc-bot commented Jul 10, 2024

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

4 participants