That changes semantics. Arrow functions don’t have a prototype, so it’s a lossy transform and so no minifier can do it safely.
Sure, the Closure compiler can do it, but that’s not usable in many existing projects.
-
-
I mean, it’s a pretty basic analysis if it’s all lexical. But most functions escape and unless you have complex scape analysis it’s difficult but doable. Sorry if it seemed I was talking in absolutes. The minifiers the community use today just aren’t equipped.
-
I didn't see an absolute in your earlier comments. Am trying to make Closure Compiler more approachable for Open Source Projects and this looks like a clear win for that work.
End of conversation
New conversation -
-
-
If it did it it would do it in simple optimization mode since it is safe to do. Uglify already does similar optimizations (e.g. dead code elimination within a lexical scope).
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 