[Pkg-javascript-commits] [uglifyjs] 201/491: fix `ie8` mangling of top-level `AST_SymbolCatch` (#2263)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:51:35 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 e7c21e87e3a3d1c9700941ecdf97a2a50fa2ae66
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Tue Aug 1 02:38:32 2017 +0800

    fix `ie8` mangling of top-level `AST_SymbolCatch` (#2263)
    
    fixes #2254
---
 lib/scope.js               |  1 +
 test/compress/screw-ie8.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/lib/scope.js b/lib/scope.js
index df7b207..8e766a5 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -235,6 +235,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
                     ref.reference(options);
                 });
                 node.thedef = def;
+                node.reference(options);
                 return true;
             }
         }));
diff --git a/test/compress/screw-ie8.js b/test/compress/screw-ie8.js
index 5d6f1e2..66559b0 100644
--- a/test/compress/screw-ie8.js
+++ b/test/compress/screw-ie8.js
@@ -325,3 +325,69 @@ issue_2120_2: {
     }
     expect_stdout: "PASS"
 }
+
+issue_2254_1: {
+    mangle = {
+        ie8: false,
+    }
+    input: {
+        "eeeeee";
+        try {
+            console.log(f("PASS"));
+        } catch (e) {}
+        function f(s) {
+            try {
+                throw "FAIL";
+            } catch (e) {
+                return s;
+            }
+        }
+    }
+    expect: {
+        "eeeeee";
+        try {
+            console.log(f("PASS"));
+        } catch (e) {}
+        function f(e) {
+            try {
+                throw "FAIL";
+            } catch (t) {
+                return e;
+            }
+        }
+    }
+    expect_stdout: "PASS"
+}
+
+issue_2254_2: {
+    mangle = {
+        ie8: true,
+    }
+    input: {
+        "eeeeee";
+        try {
+            console.log(f("PASS"));
+        } catch (e) {}
+        function f(s) {
+            try {
+                throw "FAIL";
+            } catch (e) {
+                return s;
+            }
+        }
+    }
+    expect: {
+        "eeeeee";
+        try {
+            console.log(f("PASS"));
+        } catch (e) {}
+        function f(t) {
+            try {
+                throw "FAIL";
+            } catch (e) {
+                return t;
+            }
+        }
+    }
+    expect_stdout: "PASS"
+}

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