fixed run-tests and an issue about reversing the condition in AST_If
This commit is contained in:
@@ -745,6 +745,7 @@ function Compressor(options, false_by_default) {
|
||||
var negated = self.condition.negate(compressor);
|
||||
var negated_is_best = best_of(self.condition, negated) === negated;
|
||||
if (self.alternative && negated_is_best) {
|
||||
negated_is_best = false; // because we already do the switch here.
|
||||
self.condition = negated;
|
||||
var tmp = self.body;
|
||||
self.body = self.alternative || new AST_EmptyStatement();
|
||||
@@ -776,7 +777,7 @@ function Compressor(options, false_by_default) {
|
||||
right : self.body.body
|
||||
}).optimize(compressor)
|
||||
});
|
||||
else return make_node(AST_SimpleStatement, self, {
|
||||
return make_node(AST_SimpleStatement, self, {
|
||||
body: make_node(AST_Binary, self, {
|
||||
operator : "&&",
|
||||
left : self.condition,
|
||||
|
||||
@@ -885,7 +885,7 @@ function OutputStream(options) {
|
||||
});
|
||||
DEFPRINT(AST_Symbol, function(self, output){
|
||||
var def = self.definition();
|
||||
output.print_name(def.mangled_name || def.name);
|
||||
output.print_name(def ? def.mangled_name || def.name : self.name);
|
||||
});
|
||||
DEFPRINT(AST_This, function(self, output){
|
||||
output.print("this");
|
||||
|
||||
Reference in New Issue
Block a user