From: Alex Lam S.L Date: Sat, 4 Mar 2017 17:54:20 +0000 (+0800) Subject: resolve issue with outdated version of async (#1549) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=ea9ab9fb0e48b4bf011da67f86652f148ae6ed1a;p=UglifyJS.git resolve issue with outdated version of async (#1549) fixes #746 --- diff --git a/bin/uglifyjs b/bin/uglifyjs index 367d66e2..4dd234dc 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -8,7 +8,6 @@ var sys = require("util"); var yargs = require("yargs"); var fs = require("fs"); var path = require("path"); -var async = require("async"); var acorn; var screw_ie8 = true; var ARGS = yargs @@ -319,8 +318,11 @@ var STATS = {}; var TOPLEVEL = null; var P_RELATIVE = ARGS.p && ARGS.p == "relative"; var SOURCES_CONTENT = {}; +var index = 0; -async.eachLimit(files, 1, function (file, cb) { +!function cb() { + if (index == files.length) return done(); + var file = files[index++]; read_whole_file(file, function (err, code) { if (err) { print_error("ERROR: can't read file: " + file); @@ -388,7 +390,9 @@ async.eachLimit(files, 1, function (file, cb) { }); cb(); }); -}, function () { +}(); + +function done() { var OUTPUT_FILE = ARGS.o; var SOURCE_MAP = (ARGS.source_map || ARGS.source_map_inline) ? UglifyJS.SourceMap({ @@ -537,7 +541,7 @@ async.eachLimit(files, 1, function (file, cb) { })); } } -}); +} /* -----[ functions ]----- */ diff --git a/package.json b/package.json index f152a51e..4512eb71 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "LICENSE" ], "dependencies": { - "async": "~0.2.6", "source-map": "~0.5.1", "uglify-to-browserify": "~1.0.0", "yargs": "~3.10.0"