mishoo/UglifyJS — pull request #327 by RGustBardon (2012-02-28 12:53:56+00:00)
Title: Enhances UglifyJS with consolidation of null, Boolean, and String values.

Also known as aliasing, this feature has been deprecated in the Closure Compiler since its initial release, where it is unavailable from the CLI. The Closure Compiler allows one to log and influence this process. In contrast, this implementation does not introduce any variable declarations in global code and derives String values from identifier names used as property accessors.

Consolidating literals may worsen the data compression ratio when an encoding transformation is applied. For instance, jQuery 1.7.1 takes 248235 bytes. Building it with UglifyJS v1.2.5 results in 93647 bytes (37.73% of the original) which are then compressed to 33154 bytes (13.36% of the original) using gzip(1). Building it with the same version of UglifyJS 1.2.5 patched with the implementation of consolidation results in 80784 bytes (a decrease of 12863 bytes, i.e. 13.74%, in comparison to the aforementioned 93647 bytes) which are then compressed to 34013 bytes (an increase of 859 bytes, i.e. 2.59%, in comparison to the aforementioned 33154 bytes).

Written in the strict variant of ECMA-262 5.1 Edition. Encoded in UTF-8. Follows Revision 2.28 of the Google JavaScript Style Guide (except for the discouraged use of the namespace tag). 100% typed for the Closure Compiler Version 1741.

Development files are located in another repository ().