-
Notifications
You must be signed in to change notification settings - Fork 119
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
identifier mangler on default parameters #41
Comments
a possible but not ideal fix would just be moving the variable assignment down let adad = 1
function func(arg1, arg2 = 0, arg3 , arg4 = 30) {
arg3 = adad
return arg1;
} |
Yeah that's a known issue: babel/minify#1023 Your suggested fix could work with some changes so I'll try applying it for now, but the name mangling will eventually be redesigned from scratch: #21 let adad = 1
// dummy default param to retain arguments.length and func.length == 1 behaviour
function func(arg1, arg2 = 0, arg3 = undefined , arg4 = 30) {
if (arg3 === undefined) arg3 = adad; // only set when the arg isn't passed
return arg1;
} |
Could you check if everything works now? https://deploy-preview-42--webcrack.netlify.app/ |
this file gives me the same error |
I just tried it again, and now it works... |
oops had a bug in it, |
when i looked at it, i was like thats not gonna work, but then i got distracted and forgot to write the comment |
when will this fix be released? |
I released it now |
Describe the bug
When passing an identifier as a default parameter valuee, i doest work
the error seems to come from "babel-plugin-minify-mangle-names/lib/scope-tracker.js"
line 47
Expected Behaviour
Code
The text was updated successfully, but these errors were encountered: