var optimist = require("optimist");
var fs = require("fs");
var ARGS = optimist
- .usage("uglifyjs2 [options] input1.js input2.js ...\n\
-(maximum compression settings are on by default)\
+ .usage("uglifyjs2 [options] input1.js [input2.js ...]\n\
+Maximum compression settings are on by default.\n\
+Use a single dash to read input from the standard input.\
")
.describe("source-map", "Specify an output file where to generate source map")
.describe("source-map-root", "The root of the original source to be included in the source map")
sequences : !false_by_default,
properties : !false_by_default,
dead_code : !false_by_default,
- keep_comps : !false_by_default,
drop_debugger : !false_by_default,
unsafe : !false_by_default,
conditionals : !false_by_default,
return [ this ];
}
});
+ def(AST_Statement, function(){
+ throw new Error("Cannot evaluate a statement");
+ });
function ev(node) {
return node._eval();
};
return basic_negation(this);
});
def(AST_Statement, function(){
- throw new Error("Cannot evaluate a statement");
+ throw new Error("Cannot negate a statement");
});
def(AST_UnaryPrefix, function(){
if (this.operator == "!")
if (!self.alternative && self.body instanceof AST_SimpleStatement) {
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
- operator: "&&",
- left: self.condition,
- right: self.body.body
+ operator : "&&",
+ left : self.condition,
+ right : self.body.body
}).optimize(compressor)
});
}
&& !(self.alternative instanceof AST_EmptyStatement)) {
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
- operator: "||",
- left: self.condition,
- right: self.alternative.body
+ operator : "||",
+ left : self.condition,
+ right : self.alternative.body
}).optimize(compressor)
});
}