diff options
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/compress.js b/lib/compress.js index 1845717c..5879b93b 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -916,7 +916,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); }); @@ -934,16 +934,16 @@ 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); }); // methods to determine if an expression has a string result type (function (def){ - def(AST_Node, function(){ return false }); - def(AST_String, function(){ return true }); + def(AST_Node, return_false); + def(AST_String, return_true); def(AST_UnaryPrefix, function(){ return this.operator == "typeof"; }); @@ -1197,11 +1197,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"); @@ -1221,13 +1221,13 @@ 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_Defun, return_true); + def(AST_Function, return_false); 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) |