[Pkg-javascript-commits] [uglifyjs] 252/491: remove dead code (#2405)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:51:41 UTC 2018


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.

commit 31f82091930b39ebb5d9358951c39ae20cf8057e
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Fri Oct 27 14:28:09 2017 +0800

    remove dead code (#2405)
---
 lib/compress.js | 29 -----------------------------
 1 file changed, 29 deletions(-)

diff --git a/lib/compress.js b/lib/compress.js
index a2dd243..4817ec5 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1647,35 +1647,6 @@ merge(Compressor.prototype, {
                     && unaryPrefix(this.operator);
             }
         });
-        // Obtain the constant value of an expression already known to be constant.
-        // Result only valid iff this.is_constant() is true.
-        AST_Node.DEFMETHOD("constant_value", function(compressor){
-            // Accomodate when option evaluate=false.
-            if (this instanceof AST_Constant && !(this instanceof AST_RegExp)) {
-                return this.value;
-            }
-            // Accomodate the common constant expressions !0 and -1 when option evaluate=false.
-            if (this instanceof AST_UnaryPrefix
-                && this.expression instanceof AST_Constant) switch (this.operator) {
-              case "!":
-                return !this.expression.value;
-              case "~":
-                return ~this.expression.value;
-              case "-":
-                return -this.expression.value;
-              case "+":
-                return +this.expression.value;
-              default:
-                throw new Error(string_template("Cannot evaluate unary expression {value}", {
-                    value: this.print_to_string()
-                }));
-            }
-            var result = this.evaluate(compressor);
-            if (result !== this) {
-                return result;
-            }
-            throw new Error(string_template("Cannot evaluate constant [{file}:{line},{col}]", this.start));
-        });
         def(AST_Statement, function(){
             throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start));
         });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list