Merge branch 'master' into harmony
This commit is contained in:
@@ -932,7 +932,7 @@ merge(Compressor.prototype, {
|
||||
(function (def){
|
||||
var unary_bool = [ "!", "delete" ];
|
||||
var binary_bool = [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ];
|
||||
def(AST_Node, function(){ return false });
|
||||
def(AST_Node, return_false);
|
||||
def(AST_UnaryPrefix, function(){
|
||||
return member(this.operator, unary_bool);
|
||||
});
|
||||
@@ -950,8 +950,8 @@ merge(Compressor.prototype, {
|
||||
def(AST_Seq, function(){
|
||||
return this.cdr.is_boolean();
|
||||
});
|
||||
def(AST_True, function(){ return true });
|
||||
def(AST_False, function(){ return true });
|
||||
def(AST_True, return_true);
|
||||
def(AST_False, return_true);
|
||||
})(function(node, func){
|
||||
node.DEFMETHOD("is_boolean", func);
|
||||
});
|
||||
@@ -1228,11 +1228,11 @@ merge(Compressor.prototype, {
|
||||
|
||||
// determine if expression has side effects
|
||||
(function(def){
|
||||
def(AST_Node, function(compressor){ return true });
|
||||
def(AST_Node, return_true);
|
||||
|
||||
def(AST_EmptyStatement, function(compressor){ return false });
|
||||
def(AST_Constant, function(compressor){ return false });
|
||||
def(AST_This, function(compressor){ return false });
|
||||
def(AST_EmptyStatement, return_false);
|
||||
def(AST_Constant, return_false);
|
||||
def(AST_This, return_false);
|
||||
|
||||
def(AST_Call, function(compressor){
|
||||
var pure = compressor.option("pure_funcs");
|
||||
@@ -1252,15 +1252,15 @@ merge(Compressor.prototype, {
|
||||
def(AST_SimpleStatement, function(compressor){
|
||||
return this.body.has_side_effects(compressor);
|
||||
});
|
||||
def(AST_Defun, function(compressor){ return true });
|
||||
def(AST_Function, function(compressor){ return false });
|
||||
def(AST_Class, function(compressor){ return false });
|
||||
def(AST_DefClass, function(compressor){ return true });
|
||||
def(AST_Defun, return_true);
|
||||
def(AST_Function, return_false);
|
||||
def(AST_Class, return_false);
|
||||
def(AST_DefClass, return_true);
|
||||
def(AST_Binary, function(compressor){
|
||||
return this.left.has_side_effects(compressor)
|
||||
|| this.right.has_side_effects(compressor);
|
||||
});
|
||||
def(AST_Assign, function(compressor){ return true });
|
||||
def(AST_Assign, return_true);
|
||||
def(AST_Conditional, function(compressor){
|
||||
return this.condition.has_side_effects(compressor)
|
||||
|| this.consequent.has_side_effects(compressor)
|
||||
|
||||
Reference in New Issue
Block a user