aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2012-10-09 03:04:33 -0700
committerMihai Bazon <mihai.bazon@gmail.com>2012-10-09 03:04:33 -0700
commit9dfcd47ec8fef20a7c6f994bb8896a16ffa0eb2b (patch)
tree20d556a14c8e2fa28ef5564162324478a17cf96b
parentc967f0b0fefd7db03922769f1d2aaf2ae1394ddc (diff)
parent203ecaf85ba7ad714e77c78b2102309d5581948c (diff)
downloadtracifyjs-9dfcd47ec8fef20a7c6f994bb8896a16ffa0eb2b.tar.gz
tracifyjs-9dfcd47ec8fef20a7c6f994bb8896a16ffa0eb2b.zip
Merge pull request #8 from SevInf/master
Fix crash in minify function
-rw-r--r--tools/node.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/node.js b/tools/node.js
index bf47abad..fccdd83f 100644
--- a/tools/node.js
+++ b/tools/node.js
@@ -92,9 +92,13 @@ exports.minify = function(files, options) {
// 4. output
var map = null;
+ var inMap = null;
+ if (options.inSourceMap) {
+ inMap = fs.readFileSync(options.inSourceMap, "utf8");
+ }
if (options.outSourceMap) map = UglifyJS.SourceMap({
file: options.outSourceMap,
- orig: fs.readFileSync(options.inSourceMap, "utf8")
+ orig: inMap
});
var stream = UglifyJS.OutputStream({ source_map: map });
toplevel.print(stream);