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
I removed the unnecessary temporary variable e from the last example, but mostly I'm referring to moving assignments up into the corresponding var declaration. I'm new to UglifyJS, so forgive me if I'm just missing a compiler flag.
I would like to note that this is generally the case with the output of many compilers targeting JS. LiveScript, Coco, and to an extent, Emscripten all do this. Such a pull request will be very useful. (Minified JS and minified compiled CoffeeScript should be at least close in size, particularly in these situations.)
Activity
mbarkhau commentedon Oct 17, 2013
Is this out of scope for UglifyJS?
mishoo commentedon Oct 17, 2013
Nope, not out of scope but very hard to get right in the general case. A pull request is welcome. ;-)
mbarkhau commentedon Oct 17, 2013
Ok cool. I'll see what I can do.
Do you see any edge cases where this transformation might break code?
mishoo commentedon Oct 17, 2013
Nope, absolutely not if the transformation is done properly. ;-) But it's hard. Good luck!
dead-claudia commentedon Jan 25, 2015
I would like to note that this is generally the case with the output of many compilers targeting JS. LiveScript, Coco, and to an extent, Emscripten all do this. Such a pull request will be very useful. (Minified JS and minified compiled CoffeeScript should be at least close in size, particularly in these situations.)
opportunistically turn assignment into declaration
opportunistically turn assignment into declaration
fixes mishoo#315