You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When minifying a method on an object that uses this for a default value of a parameter, swc incorrectly transforms the method to an arrow function. This is because it doesn't detect any use of this in the method body, but this is valid:
foo(a=this.bar){returna}
Input code
No response
Config
No response
Playground link (or link to the minimal reproduction)
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.
Describe the bug
When minifying a method on an object that uses
this
for a default value of a parameter, swc incorrectly transforms the method to an arrow function. This is because it doesn't detect any use ofthis
in the method body, but this is valid:Input code
No response
Config
No response
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.6.7&code=H4sIAAAAAAAAA8tXsFWo5lIAgrT8fI2yxBwgvyQjs1ivWBMqDgJFqSWlRXkKQGlrsFitDpgqtlJQKkktLlHiquXK1wMZoKmXk5qXXpIBAImD2GNXAAAA&config=H4sIAAAAAAAAA22QvW7DMAyE9zyFwdlD4CFD1xTZ%2BgwFoZwCpfqLKAM1Ar97%2FCfHLqpJuuN3Ivk8VBXdRdFH9RyuwyNyEqT1PSjS%2Bcy%2Fg0JQjkUlEzPVxb3LaGm2gknqZ4cypxvyRElzbJqFIBuCoBCL5ow3utv%2BqYKLCSIbrRwSPFp4hdE81ju3X9ty7G8WO5x%2BgPitLIt4dhOeU4v6T4H%2Bz3wH65Ac532wwBkVbPCyH2zl1qUk9jImbGdtBZ%2FQxuMS0nns7mJgr6WDmT8sGeTCtd3MRbmLmJd8ondR2WcZgYx8FXAK7V%2F1Frhm%2BQEAAA%3D%3D
SWC Info output
No response
Expected behavior
The method should not be transformed to an arrow function.
Actual behavior
No response
Version
1.6.7
Additional context
No response
The text was updated successfully, but these errors were encountered: