[Pkg-javascript-commits] [uglifyjs] 02/11: Show descriptive error when --mangle-regex is invalid

Jonas Smedegaard dr at jones.dk
Wed Aug 26 09:34:58 UTC 2015


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

js pushed a commit to tag v2.4.24
in repository uglifyjs.

commit 9aef34a8168f5de3bc00330a740c22de70314a70
Author: Joao Carlos <mail at joao-carlos.com>
Date:   Tue Jun 9 14:31:49 2015 +0300

    Show descriptive error when --mangle-regex is invalid
---
 bin/uglifyjs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/uglifyjs b/bin/uglifyjs
index 71c8264..9a1323f 100755
--- a/bin/uglifyjs
+++ b/bin/uglifyjs
@@ -376,7 +376,15 @@ async.eachLimit(files, 1, function (file, cb) {
     if (ARGS.mangle_props || ARGS.name_cache) (function(){
         var reserved = RESERVED ? RESERVED.props : null;
         var cache = readNameCache("props");
-        var regex = ARGS.mangle_regex ? new RegExp(ARGS.mangle_regex) : null;
+        var regex;
+
+        try {
+          regex = ARGS.mangle_regex ? new RegExp(ARGS.mangle_regex) : null;
+        } catch (e) {
+            print_error("ERROR: Invalid --mangle-regex: " + e.message);
+            process.exit(1);
+        }
+
         TOPLEVEL = UglifyJS.mangle_properties(TOPLEVEL, {
             reserved   : reserved,
             cache      : cache,

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