aboutsummaryrefslogtreecommitdiff
path: root/bin/uglifyjs2
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-09-14 15:36:38 +0300
committerMihai Bazon <mihai@bazon.net>2012-09-14 15:36:38 +0300
commit924aa580602a4ad94f1079dcd157286314066553 (patch)
treeacd65dd576ded856e5e7cc3b15ee473539b645ac /bin/uglifyjs2
parent93b973c99dd25aeff66ff31f2881e9ce252eaac6 (diff)
downloadtracifyjs-924aa580602a4ad94f1079dcd157286314066553.tar.gz
tracifyjs-924aa580602a4ad94f1079dcd157286314066553.zip
more optimizations that v1 does and some cleanups
- a = a + x ==> a+=x - joining consecutive var statements (hoisting is not always desirable) - x == false ==> x == 0, x != true ==> x != 1 - x, x ==> x; x = exp(), x ==> x = exp() - discarding useless break-s
Diffstat (limited to 'bin/uglifyjs2')
-rwxr-xr-xbin/uglifyjs210
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/uglifyjs2 b/bin/uglifyjs2
index fd57a662..e753631c 100755
--- a/bin/uglifyjs2
+++ b/bin/uglifyjs2
@@ -18,18 +18,20 @@ Use a single dash to read input from the standard input.\
.describe("v", "Verbose")
.describe("b", "Beautify output")
.describe("m", "Don't mangle names")
- .describe("c", "Compressor options")
+ .describe("c", "Pass compressor options")
.alias("p", "prefix")
.alias("o", "output")
.alias("v", "verbose")
.alias("b", "beautify")
.alias("c", "options")
+ .alias("m", "no-mangle")
.boolean("b")
.boolean("v")
.boolean("stats")
.boolean("m")
+ .string("c")
.argv
;
@@ -121,9 +123,9 @@ if (ARGS.stats) {
/* -----[ functions ]----- */
function do_file_1(file) {
- // if (ARGS.v) {
- // sys.error("Compressing " + file);
- // }
+ if (ARGS.v) {
+ sys.error("Compressing " + file);
+ }
var code = read_whole_file(file);
var ast;
time_it("parse", function(){