[Pkg-javascript-commits] [uglifyjs] 37/190: have minify() call figure_out_scope() if needed to produce well formed "use asm" code

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:11 UTC 2016


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

terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.

commit e870c7db45aca4cb1585d5b10e631ab293e8dc3a
Author: kzc <zaxxon2011 at gmail.com>
Date:   Wed Oct 7 16:31:57 2015 -0400

    have minify() call figure_out_scope() if needed to produce well formed "use asm" code
---
 tools/node.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/node.js b/tools/node.js
index f604866..7e61d2a 100644
--- a/tools/node.js
+++ b/tools/node.js
@@ -45,6 +45,7 @@ exports.minify = function(files, options) {
     UglifyJS.base54.reset();
 
     // 1. parse
+    var haveScope = false;
     var toplevel = null,
         sourcesContent = {};
 
@@ -73,6 +74,7 @@ exports.minify = function(files, options) {
         var compress = { warnings: options.warnings };
         UglifyJS.merge(compress, options.compress);
         toplevel.figure_out_scope();
+        haveScope = true;
         var sq = UglifyJS.Compressor(compress);
         toplevel = toplevel.transform(sq);
     }
@@ -80,11 +82,17 @@ exports.minify = function(files, options) {
     // 3. mangle
     if (options.mangle) {
         toplevel.figure_out_scope(options.mangle);
+        haveScope = true;
         toplevel.compute_char_frequency(options.mangle);
         toplevel.mangle_names(options.mangle);
     }
 
-    // 4. output
+    // 4. scope (if needed)
+    if (!haveScope) {
+        toplevel.figure_out_scope();
+    }
+
+    // 5. output
     var inMap = options.inSourceMap;
     var output = {};
     if (typeof options.inSourceMap == "string") {

-- 
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