diff options
author | Mihai Bazon <mihai.bazon@gmail.com> | 2012-10-09 03:04:33 -0700 |
---|---|---|
committer | Mihai Bazon <mihai.bazon@gmail.com> | 2012-10-09 03:04:33 -0700 |
commit | 9dfcd47ec8fef20a7c6f994bb8896a16ffa0eb2b (patch) | |
tree | 20d556a14c8e2fa28ef5564162324478a17cf96b | |
parent | c967f0b0fefd7db03922769f1d2aaf2ae1394ddc (diff) | |
parent | 203ecaf85ba7ad714e77c78b2102309d5581948c (diff) | |
download | tracifyjs-9dfcd47ec8fef20a7c6f994bb8896a16ffa0eb2b.tar.gz tracifyjs-9dfcd47ec8fef20a7c6f994bb8896a16ffa0eb2b.zip |
Merge pull request #8 from SevInf/master
Fix crash in minify function
-rw-r--r-- | tools/node.js | 6 |
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); |