[Pkg-javascript-commits] [uglifyjs] 02/190: fromString option, use index from argument array for filename instead of "?"

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:06 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 4fba3e0b80c3d1a5df04fa524f550868443aa784
Author: Alberto González Palomo <bugs at sentido-labs.com>
Date:   Mon Jun 15 18:03:06 2015 +0200

    fromString option, use index from argument array for filename instead of "?"
    
    The index allows the caller to map things like parse errors back to the
    code chunk where they appeared.
---
 tools/node.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/node.js b/tools/node.js
index cbe49e3..2eb9036 100644
--- a/tools/node.js
+++ b/tools/node.js
@@ -73,13 +73,13 @@ exports.minify = function(files, options) {
     } else {
         if (typeof files == "string")
             files = [ files ];
-        files.forEach(function(file){
+        files.forEach(function(file, i){
             var code = options.fromString
                 ? file
                 : fs.readFileSync(file, "utf8");
             sourcesContent[file] = code;
             toplevel = UglifyJS.parse(code, {
-                filename: options.fromString ? "?" : file,
+                filename: options.fromString ? i : file,
                 toplevel: toplevel
             });
         });

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