public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bf617e
)
fromString option, use index from argument array for filename instead of "?"
author
Alberto González Palomo
<bugs@sentido-labs.com>
Mon, 15 Jun 2015 16:03:06 +0000
(18:03 +0200)
committer
Alberto González Palomo
<bugs@sentido-labs.com>
Mon, 15 Jun 2015 16:03:06 +0000
(18:03 +0200)
The index allows the caller to map things like parse errors back to the
code chunk where they appeared.
tools/node.js
patch
|
blob
|
history
diff --git
a/tools/node.js
b/tools/node.js
index
cbe49e3
..
2eb9036
100644
(file)
--- 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
});
});