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
{{ message }}
Repository navigation
Keep name of variable with anonymous function #191
@fabiosantoscode The commit ff16f02 is not correct enough - keep_fnames may be a regexp, but this commit treats a regexp as true when handing such functions.
Activity
fabiosantoscode commentedon Dec 19, 2018
Nice issue.
The workaround is not to mangle. Not a good workaround.
I'll start working on it.
fabiosantoscode commentedon Dec 19, 2018
...But I have no idea how to do it. I'll work on it later.
fabiosantoscode commentedon Dec 19, 2018
PRs welcome!
jahed commentedon Mar 14, 2019
This also applies to arrow functions. Using the same example with
keep_fnames,becomes
fabiosantoscode commentedon Sep 29, 2019
It should be shipped soon. I don't know what took me so long, I love using anonymous arrow functions and giving them meaningful names.
thaoms commentedon Oct 2, 2019
Thank you for fixing this! This made all our React Components that are written as functional hooks
Anonymous.fabiosantoscode commentedon Oct 2, 2019
My use case was mostly for React too!
gdh1995 commentedon Oct 10, 2019
@fabiosantoscode The commit ff16f02 is not correct enough -
keep_fnamesmay be a regexp, but this commit treats a regexp astruewhen handing such functions.fix #191: some wrong logic about keep_fnames (#489)
close terser#191 by keeping variable names of anonymous functions and…